import App from './App'
new Vue({
el: '#root', render: h => h(App) })
// 写法2:
import App from './App'
new Vue({
el: '#root',
template: '<App></App>', components: { App } })
上面两种的效果是一样的,可以看出 h(App)函数 的作用是:使用App作为这个Vue实例的template(同时一并了注册App组件)
以上个