My app initialization uses main.js
in the following way,
import App from './App.vue';
const store = {
items: [{
todo: 'Clean Apartment.',
},{
todo: 'Mow the lawn!',
},{
todo: 'Pick up eggs, milk & flour',
}, {
todo: 'Watch the big game',
}],
};
const app = new Vue({
el: '#app-zone',
data: store, // I wonder if this passes the store data into App.vue?
render: h => h(App),
});
I want to utilize the items
within App.vue
. However, I'm unsure of how or whether it gets passed down.
This is what my App.vue looks like...
export default {
props['items'], // not sure about this
created() {
console.log(this.items); // always returns undefined
}
}
How can I retrieve data from the constructor and use it effectively? Any assistance would be greatly appreciated!