1
I’m passing a array
of objects to a component and within this component I try to access past values:
<orders-list :orders="items"></orders-list>
Component orders-list:
<template>
<div>
<b-form-select
v-model="filterChannel"
:options="Array.from(
new Set(
orders.map(item => item.channel)
)
)"></b-form-select>
</div>
</template>
<script>
export default {
props: ['orders'],
...
created(){ console.log(this.orders); } // null
}
</script>
within the template
I can render all the information but the console always sends me an error saying that it cannot access the method map
of null
even rendering the items...
Already inside the method is displayed null
, but if I only use console.log(this)
I can visualize the orders
with all requests within.
How can I access a prop
within the methods of a component?
Are you receiving these Orders (items) as? With an ajax request?
– Miguel
@Miguel, yes the orders come from the component
pai
oforders-list
– RFL