Hi all,
I'm just getting started with Vue, but I can't find a direct answer for a very basic question.
Every time I see a Vue tutorial, it starts off with a Vue instance on <div id="app"> as the root element.
But is it considered as the root element for a specific component, like a list?
Or is it the root of your entire page/application?
So, is it better to have only one new Vue(), and store every model data from several components inside that one instance?
Won't this get messy and difficult to maintain?
// include on every page?
new Vue({
el: '#app',
data: {
profileData : {...},
teamData : {...},
dashboardData : {...},
...
}
})
Or do it like this?
// on same page
new Vue({
el: '#dashboard-view',
data: {
dashboardData : {...}
}
})
new Vue({
el: '#profile-component',
data: {
profileData : {...}
}
})
new Vue({
el: '#team-component',
data: {
teamData : {...}
}
})