Why does the VUE UI main.js code generated by CLI/3 differ from the older syntax, what are its parts and how does it work?
sync(store, router) // for vuex-router-sync
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
Used to be
sync(store, router) // for vuex-router-sync
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})
I also read of a third syntax for using the router without the vuex-router-sync using Vue.extend(...
rather than new Vue(
Why do I have to add render now, what is the h function replacing, why was that letter chosen, what is the $mount syntax doing and replacing, why was the $mount syntax chosen?
Also, if this is not a separate topic: Does the new syntax actually do what Vue.extend()
does, and if not when do I need to use Vue.extend()
instead of new Vue()
?