I've been pondering the preferred and best practice method for creating a Vue instance in main.js. When starting a new project using the CLI, the instance is created like this:
new Vue({
render: h => h(App)
}).$mount("#app");
However, the documentation at https://v2.vuejs.org/v2/guide/instance.html suggests creating your instance in this manner. You can either include your "el" attribute within the instance or mount it separately as shown below. The end result appears to be the same, but I'm seeking clarity on the community's best practice, reasons why one approach may be superior, and any other insights you may have.
const vm = new Vue({
data: data,
components: { App },
template: "<App/>"
});
// Mount vue
vm.$mount("#app");
Thank you all in advance!
I have combed through Vue documentation, articles, and forums, yet haven't found a definitive answer on when to use each method or which is considered best practice.