我想实现这样的例子:http://cn.vuejs.org/examples/...
它是用vue实现的,用ko的怎么做到?
我的数据结构类似这样(层级不确定):
var data=[
{
id:1,
"text": "111-1",
"children": []
},
{
id:2,
"text": "111-2",
"children": [
{
id:2-1,
"text": "111-2-1",
"children": [
{
id:2-1-1,
"text": "111-2-1-1",
"children": [
{
id:2-1-1-1,
"text": "111-2-1-1-1",
"children": []
}
]
},
{
id:2-1-2,
"text": "111-2-1-2",
"children": []
}
]
},
{
id:2-2,
"text": "111-2-2",
"children": []
},
{
id:2-3,
"text": "111-2-3",
"children": []
}
]
}
]
请大神们指教。
父组件中
子组件 记住vue中递归组件给name属性 按照name递归循环