vue使用v-for渲染列表属性需要:="items.attribute"绑定
2017-06-26 10:08
766 查看
- src="{{items.img}}": Interpolation inside attributes has been removed.
Use v-bind or the colon shorthand instead. For example,
instead of <div id="{{ val }}">, use <div :id="val">.
绑定img的src属性,一开始的写法:
<li class="zlb_list_item" v-for="items in list"> <div class="zlb_list_img"> <img src="{{items.img}}" alt=""/> </div> <div class="zlb_list_title"> <p class="zlb_list_title_level">{{items.level}}</p> <p class="zlb_list_title_date">{{items.date}}</p> </div> <div class="zlb_list_detail">{{items.price}}</div> </li>
报错:
根据提示,改成:
<img :src="items.img" alt=""/>
错误排除
相关文章推荐
- vue中如何在v-for中动态的使用将index拼接字符串后绑定id属性
- 使用百度地图2.9sdk Undefined symbols for architecture x86_64: "_NSBackgroundColorAttributeName", 问题解决方法
- Vue.js笔记第二波,Class 与 Style 绑定,条件渲染,列表渲染
- Vue------第三天(条件渲染:v-if、v-show;列表渲染:v-for)
- Vue.js入门学习--列表渲染--v-for遍历数组生成元素(四)
- VUE指令-列表渲染v-for
- Vue使用v-for报Duplicate value found in v-for="...": "". Use track-by="$index" 错误解决方法
- Vue.js列表渲染绑定jQuery插件的正确姿势
- VUE指令-列表渲染v-for
- 使用列表渲染wx-for改写新闻列表
- 学习使用vue.js(二)声明式渲染 和 指令绑定
- Vuejs——(1)入门(单向绑定、双向绑定、列表渲染、响应函数)
- Vue列表渲染指令v-for的索引$index报错Uncaught ReferenceError: $index is not defined
- 使用Devexpress 的gridControl 绑定List列表(元素对象包含List属性)的Master-Detail显示
- Win8 在给列表绑定数据时,如果有需要 异步加载的数据时,一定要使用ObservableCollection
- Vuejs——(1)入门(单向绑定、双向绑定、列表渲染、响应函数)
- Vuejs——(1)入门(单向绑定、双向绑定、列表渲染、响应函数)
- Vue.js中的列表渲染:v-for
- vue替换data里面for渲染的列表或者是循环以及替换数组的内容
- Vue报错——the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope"