Reputation: 387
Am passing an array props from a parent component to a child component i can see the props array using vue-devtools passed successfully, but when i try to render with:
<template :v-for="(item, index) in messages_array">
i get:
vue.runtime.esm.js?2b0e:619 [Vue warn]: Property or method "item" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
I want the v-for
to iterate over the prop supplied.
Below are links to image of code... tried pasting them here but couldnt format them properly.
Single File component Recieving the prop
component Recieving the prop Script
Upvotes: 1
Views: 1136
Reputation: 3285
Using v-for
instead of :v-for
should resolve your issue:
<template v-for="(item, index) in messages_array">
Full documentation can be found here: https://v2.vuejs.org/v2/guide/list.html#Mapping-an-Array-to-Elements-with-v-for
Upvotes: 0