這篇文章將為大家詳細(xì)講解有關(guān)使用vue-for指令怎么實(shí)現(xiàn)循環(huán)嵌套,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對相關(guān)知識(shí)有一定的了解。

創(chuàng)新互聯(lián)專業(yè)成都做網(wǎng)站、成都網(wǎng)站建設(shè)、成都外貿(mào)網(wǎng)站建設(shè),集網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)、網(wǎng)站制作于一體,網(wǎng)站seo、網(wǎng)站優(yōu)化、網(wǎng)站營銷、軟文推廣等專業(yè)人才根據(jù)搜索規(guī)律編程設(shè)計(jì),讓網(wǎng)站在運(yùn)行后,在搜索中有好的表現(xiàn),專業(yè)設(shè)計(jì)制作為您帶來效益的網(wǎng)站!讓網(wǎng)站建設(shè)為您創(chuàng)造效益。
具體如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin: 0;
padding: 0;
list-style: none;
}
</style>
</head>
<body>
<table id="app" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>父循環(huán)第幾次</td>
<td>子循環(huán)第幾次</td>
<td>json的第幾條數(shù)據(jù)</td>
<td>數(shù)值</td></tr>
<tbody v-for="x,index in parentList">
<tr v-for="i,index2 in x.childList">
<td>{{index}}</td>
<td>{{index2}}</td>
<td>{{i.index}}</td>
<td>{{i.childName}}</td>
</tr>
</tbody>
</table>
</body>
<script src="https://cdn.bootcss.com/vue/2.4.4/vue.min.js"></script>
<script>
const app=new Vue({
el:"#app",
data:{
parentList: [{
childList: [{
index: 1,
childName: "第一個(gè)節(jié)點(diǎn)"
}, {
index: 2,
childName: "第一個(gè)節(jié)點(diǎn)"
}, {
index: 3,
childName: "第一個(gè)節(jié)點(diǎn)"
}, {
index: 4,
childName: "第一個(gè)節(jié)點(diǎn)"
}, {
index: 5,
childName: "第一個(gè)節(jié)點(diǎn)"
}]
},
{
childList: [{
index: 6,
childName: "第二個(gè)節(jié)點(diǎn)"
}, {
index: 7,
childName: "第二個(gè)節(jié)點(diǎn)"
}, {
index: 8,
childName: "第二個(gè)節(jié)點(diǎn)"
}, {
index: 9,
childName: "第二個(gè)節(jié)點(diǎn)"
}, {
index: 10,
childName: "第二個(gè)節(jié)點(diǎn)"
}]
},
{
childList: [{
index: 11,
childName: "第三個(gè)節(jié)點(diǎn)"
}, {
index: 12,
childName: "第三個(gè)節(jié)點(diǎn)"
}, {
index: 13,
childName: "第三個(gè)節(jié)點(diǎn)"
}, {
index: 14,
childName: "第三個(gè)節(jié)點(diǎn)"
}, {
index: 15,
childName: "第三個(gè)節(jié)點(diǎn)"
}]
}]
}
})
</script>
</html>關(guān)于使用vue-for指令怎么實(shí)現(xiàn)循環(huán)嵌套就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
文章題目:使用vue-for指令怎么實(shí)現(xiàn)循環(huán)嵌套
當(dāng)前網(wǎng)址:http://www.chinadenli.net/article34/gceope.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站、網(wǎng)站維護(hù)、外貿(mào)建站、虛擬主機(jī)、小程序開發(fā)、做網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)