2👍
✅
Just bind with v-bind:items="result"
. Since you wrapped the bound value in {...}
you made an object literal. Just "result"
will pass the array.
2👍
Vue has a prop which can be of any data type.
Out of all data types, Object, Array should be a function for their default values.
export default {
props: {
items: {
type: Array,
default: () => [
{ message: 'Foo' },
{ message: 'Bar' }
]
},
},
}
And v-bind:items
can already have javascript variable.
so
<ErrorAlert v-bind:items="result"/>
Source:stackexchange.com