循環(huán)數(shù)組列表渲染昼丑;
// 代碼演示demo
// 完整demo
<template>
<div class="test">
<div>測試</div>
<button @click="test">測試this.$message.error</button>
<div>v-for</div>
<ul>
<li v-for="item in arr">
<p v-for="items in item.img1">{{items.imgurl}}</p> // 循環(huán)數(shù)組成功
<p>{{item.img2}}</p>
</li>
</ul>
</div>
</template>
<script>
export default {
data () {
return {
arr:[
{'img1': [
{'imgurl': '循環(huán)數(shù)組成功'},
{'order': ''},
{'info': ''},
{'radio': ''}
]}, {
'img2':[
{'imgurl': '1'},
{'order': '2',},
{'info': '3'},
{'radio':'4'}
]}
]
}
},
methods:{
test(){
console.log(this.$message)
}
},
mounted () {
console.log(this.arr)
}
}
</script>
<style>
</style>