data:Array [{name:'',children:[]}]
property:Object {name:'name',children:'children'}
icon:
<c-tree :data="data" :property="property"></tree>
import CTree from './c-tree.js';
{
components:{
CTree
}
}
或
<script src="./c-tree.js"></script>
<script>
Vue.component('demo',{
template:'<div>'+
'<c-tree :data="data" :property="property"></tree>'+
'</div>',
data:function(){
return {
data:[
{
name: '开始开始开',
childrens: [
{
name: '开始2',
childrens: [
{
name: '开始2'
},
{
name: '开始2'
},
]
},
{
name: '开始2',
childrens: [
{
name: '开始2'
},
{
name: '开始2'
},
]
},
{
name: '开始2'
},
{
name: '开始2'
},
]
},
{
name: '开始开始开始开始开始开始开始',
childrens: [
{
name: '开始2'
},
{
name: '开始2'
}
]
},
],
property:{name:'name',children:'children'}
}
}
})
</script>