vue.js如何遍历以下数据


block:{

name:'碧海蓝天1号楼',

units:[{

num:'1单元',

floors:[

{

num:'1楼',

house:[

{num:'101'},

{num:'102'}

]

},

{

num:'2楼',

houses:[

{num:'201'},

{num:'202'}

]

}

]

},

{

num:'2单元',

floors:[{

num:'1楼',

houses:[

{num:'103'},

{num:'104'}

]

},

{

num:'2楼',

houses:[

{num:'203'},

{num:'204'}

]

}]

},{

num:'3单元',

floors:[{

num:'1楼',

houses:[

{num:'105'},

{num:'106'}

]

},

{

num:'2楼',

houses:[

{num:'205'},

{num:'206'}

]

}]

}]

}

//效果图

https://img3.mukewang.com/5b86621a0001dddd02650125.jpg

浊酒丶
浏览 1525回答 1
1回答

kixv

<!--表头--><div v-for="a in block" v-text="a.name"></div><!--body--><div v-for="a in block" v-text="a.name">     <div v-for="o in a" v-text="o.num"></div></div>样式自己写啦
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Vue.js