vue2.0 方法render

new Vue({
  el:'#one',
  //components: { App }  vue1.0的写法
  render: h => h(App)    vue2.0的写法
})

render函数是渲染一个视图,然后提供给el挂载,如果没有render那页面什么都不会出来,表示 Vue 实例选项对象的 render 方法作为一个函数,接受传入的参数 h 函数,返回 h(App) 的函数调用结果。

组件定义的话,组件内部直接export default然后声明name,外部引用就components:{App}

猜你喜欢

转载自blog.csdn.net/D_claus/article/details/84140145