vue组件的配置属性

vue组件的声明语法:

Vue.component('component-name',{

template:'<p>段落{{prop1}} {{prop2}}</p>',

data:function(){

return {prop1:'aa',prop2:'bb'}

},

methods:{

fn1:function(){},

fn2:function(){}

},

props:['value','label','custom'],

render:function(createElement){

return createElement('div','hello,world')

}

})

 

posted @ 2016-11-21 10:30  向着太阳生  阅读(3208)  评论(0编辑  收藏  举报