vue temp render 待编辑

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组件)

以上个

猜你喜欢

转载自www.cnblogs.com/infaaf/p/9690211.html