以这段代码为例子
new Vue({ router, store, render: h => h(App) }).$mount('#app')
render函数的作用就是将App那个vue组件渲染成DOM节点。
render函数里面的形参,可以做到这一点,所以 h这个函数 , 里面传进去一个App组件。
注意: h 代表的是createElement
以这段代码为例子
new Vue({ router, store, render: h => h(App) }).$mount('#app')
render函数的作用就是将App那个vue组件渲染成DOM节点。
render函数里面的形参,可以做到这一点,所以 h这个函数 , 里面传进去一个App组件。
注意: h 代表的是createElement
转载于:https://www.cnblogs.com/tengyuxin/p/11149120.html