v-for 数组参数的顺序
当含有 index 时, 以前传递的参数顺序是:
(index, value). 现在 (value, index)
ready 替换使用新的 mounted 钩子代替, 通过使用 mounted 钩子, 并不能保证实例已经插入文档, 所以还应用在钩子函数中包含 vue.nextTick
vm.$nextTick 列如
- mounted: function() {
- this.$nextTick(function() {
- // 保证 this.$el 已经插入文档
- })
- }
image.PNG
- cartData.JSON
- {
- "status": 1,
- "result": {
- "totalMoney": 59,
- "list": [
- {
- "productId": "600100002115",
- "productName": "达",
- "productPrice": 12,
- "productQuentity: 1,
- "productImage": "img/goods-1.jpg",
- "parts": [
- {
- "partsId": "10001",
- "partsName": "打火机"
- }
- ]
- },
- {
- "productId": "600100002115",
- "productName": "达",
- "productPrice": 12,
- "productQuentity: 1,
- "productImage": "img/goods-1.jpg",
- "parts": [
- {
- "partsId": "10001",
- "partsName": "打火机"
- }
- ]
- }
- ]
- },
- "message": ""
- }
image.PNG
image.PNG
image.PNG
image.PNG
image.PNG
image.PNG
image.PNG
image.PNG
vue 过滤器的使用:
使用 v-on 绑定事件, 实现金额动态计算
image.PNG
请点赞! 因为你的鼓励是我写作的最大动力!
官方微信公众号
吹逼交流群: 711613774
吹逼交流群
来源: http://www.jianshu.com/p/98e87a51b08a