循环遍历 VueJS 中的数据数组属性 [英] Looping through data array properties in VueJS

查看:34
本文介绍了循环遍历 VueJS 中的数据数组属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 vuejs 中你可以在模板中做列表渲染

In vuejs you can do list rendering in the template like

<td v-for="item in items"></td>......

但是你能像...一样迭代相同的数据数组属性吗

But can you iterate over that same data array property like....

for(var i = 0; i < this.items.length; i++)
 this.$data.items[i]

推荐答案

不用担心this.$data.items,而是this.items,虽然它也可以工作......

Just don't worry about the this.$data.items, instead this.items, although it would also work ...

这篇关于循环遍历 VueJS 中的数据数组属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆