VueJS access child component’s data from parent
VueJS access child component’s data from parent
This module is user friendly,
VueJS gives answer that’s why it’s known as Vuex. Check whether it is not able to go with Vuex, By creating its own simple store.
The following this code,
export default { data: { items: [] }, // Methods that you need, for e.g fetching data from server etc. fetchData() { // fetch logic } }
From data everywhere, with importing this Store file
indexview.vue
import MarkdownStore from '../stores/MarkdownStore' export default { data() { sharedItems: MarkdownStore.data }, created() { MarkdownStore.fetchData() } }