vue

2018-05-30 vue render 嵌套多个标签

2018-05-30  本文已影响149人  他大舅啊
<tb-heading> </tb-heading>
    function func1(createElement){
        return createElement('div','div')
    }

    function func2(createElement){
        return createElement('i','iiiii')
    }
    function func3(createElement){
        return createElement('b','bbbbb')
    }

    Vue.component('tb-heading',{
        render: function(createElement){
            return createElement('div',[
                func1(createElement),func2(createElement),func3(createElement)
            ])
        },
        props:{
            level:{
                type:Number,
                required:true
            }
        }
    })
上一篇下一篇

猜你喜欢

热点阅读