<template>
<button @click="active=true">
<modal v-if="active" :product_id="product_id">
</template>
<template>
<div v-show="active">
<list-item v-for="item in items"></list-item>
</div>
</template>
export default {
props: ['product_id'],
data() {
return {
active: false,
items: []
}
},
created() {
axios.get(`/json/datalist/${this.product_id}`)
.then(response => {
this.items = response.data.data;
this.active = true
})
}
}
my_data['2018-07-11'] && my_data['2018-07-11']['may']
{
path: '/admin',
component: AdminLayout,
redirect: { name: 'dashboard' },
children: [
{
path: 'dashboard',
name: 'dashboard',
component: Dashboard,
meta: {
requiresAuth: true
},
},
{
path: 'users',
name: 'users',
component: UserLists,
},
]
}
mounted () {
bus.$on('selectedCompanies', (data) => {
console.log('data', data)
this.items = data
console.log('this.items', this.items)
})
console.log('subscribed!')
},