new Vue({
router,
store,
}).$mount('#app')
new Vue({
el: '#app',
store,
router,
template: '<App/>',
components: { App }
})
What is the difference between these two ways of instantiating Vue?
What is the relationship between the three files main.js, App.vue, and index.html in the project structure?
First of all, there is no essential difference between these two writing methods, and there is no problem as the entrance to the entire project.
Specifically speaking of the project structure, main.js is the entrance to the entire project (in addition to importing the UI of App.vue, auxiliary libraries and plug-ins such as router/vuex/axios are also imported). App.vue is the entrance to the UI logic. Index.html introduces main.js through the script tag and injects the content of the script execution into #app.