Vue 在table中使用v-for,满足一定条数换行

 
{{chapterList[index]==null?"":chapterList[index].name}} {{chapterList[index+1]==null?"":chapterList[index+1].name}} {{chapterList[index+2]==null?"":chapterList[index+2].name}} {{chapterList[index+3]==null?"":chapterList[index+3].name}}

我遍历的数据

"chapterList": [{
	"id": 1,
	"novelCode": "fgjgjgjh",
	"name": "第一章防守对方答复",
	"content": "案发时发生",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}, {
	"id": 2,
	"novelCode": "fgjgjgjh",
	"name": "第二章防守对方答复",
	"content": "案发生",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}, {
	"id": 3,
	"novelCode": "fgjgjgjh",
	"name": "第三章防守对方答复",
	"content": "案发生222",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}, {
	"id": 4,
	"novelCode": "fgjgjgjh",
	"name": "第四章防守对方答复",
	"content": "案发生222",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}, {
	"id": 5,
	"novelCode": "fgjgjgjh",
	"name": "第五章防守对方答复",
	"content": "案发生222",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}, {
	"id": 6,
	"novelCode": "fgjgjgjh",
	"name": "第六章防守对方答复",
	"content": "案发生222",
	"wordNum": 3533,
	"path": null,
	"createtime": "2020-01-12T07:37:39.000+0000",
	"updatetime": "2020-01-12T07:37:42.000+0000",
	"status": 0
}]

 

你可能感兴趣的:(Vue,前端)