VueComponent和Vue联系

VueComponent和Vue的联系

VueComponent.prototype.proto == Vue.prototype
VueComponent的原型对象的原型对象 等于 Vue的原型对象

例子验证:

创建一个组件
Vue.js

const school = Vue.extend({
   
        template:`
          

{ {schoolName}}

{ {address}}

`
, data(){ return { schoolName:'徐州大学', address: '徐州' } } }) //注册组件 new Vue({ el:'#root', components:{ school } })

你可能感兴趣的:(学习笔记,study,vue.js,javascript,html5)