<div id="app">
<!--<router-view/>-->
<div class="shortcut-box">
<div v-for="(item,value,index) in shortcut"
>
{{ index }}
<div :style="setCoordinates(index)">
</div> </div> </div></div>
data () {
return {
locale: zhCN,
shortcut: {
wo: ["55", '11'],
wo1: ["55", '11'],
wo2: ["55", '11'],
wo3: ["55", '11'],
wo4: ["55", '11'],
wo5: ["55", '11'],
wo6: ["55", '11'],
wo7: ["55", '11']
},
count: 0
}
},
mounted () {
},
methods: {
setCoordinates: function (index) {
if (index%4==0) {
this.count++
console.log(this.count)
}
}
}
这儿的count会无限增加,但是但是数据来说,应该只执行7次就够了。
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…