浅谈Vue2.0中v-for迭代语法的变化(key、index)
2018-03-06 09:17
615 查看
今天,在写关于Vue2.0的代码中发现 $key这个值并不能渲染成功,问题如下:
结果这个对象的key值并不能够显示:
后来查阅了文档才知道,这是因为在Vue2.0中,v-for迭代语法已经发生了变化:
丢弃了:
新数组语法
value in arr (value, index) in arr
新对象语法
value in obj (value, key) in obj (value, key, index) in obj
解决后:
以上这篇浅谈Vue2.0中v-for迭代语法的变化(key、index)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- Vue2.0中v-for迭代语法变化(key、index)
- Vue2.0中v-for迭代语法变化(key、index)【转】
- ORA-02429: cannot drop index used for enforcement of unique/primary key
- java.lang.IllegalStateException: Fragement no longer exists for key f0: index 0
- java.lang.IllegalStateException: Fragement no longer exists for key f0: index 0
- Fragment no longer exists for key f0: index 0
- ORA-02429: cannot drop index used for enforcement of unique/primary key
- ORA-02429: cannot drop index used for enforcement of unique /primary key
- Vue 2.0 v-for 响应式key, index及item.id参数对v-bind:key值造成差异研究
- [Sybase] Foreigh Key/Index column
- 浅谈python for循环的巧妙运用(迭代、列表生成式)
- Fragment no longer exists for key f0: index 0
- Vue 2.0 v-for 响应式key, index及item.id参数对v-bind:key值造成差异研究
- java.lang.IllegalStateException: Fragement no longer exists for key f0: index 0
- 1.this class is not key value coding-compliant for the key _blockView2.Block语法防止循环引用
- OC 可变字典下标[]语法糖不是 setObject:forKey: 而等效于 KVC
- A workaround for limitation of 900 bytes index key
- Missing message for key "index.title"
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- this class is not key value coding-compliant for the key xxxxx.