昨天刚踩了2.0的$index的坑。搞了半天!在vue2.0 v-for中index索引的值获取方式是(item,index) in items的方式获取
2017-02-12
加v-model="item.productQuentity"报了这个错:
[Vue warn]: <input v-model="item.productQuentity" value="0">:
inline value attributes will be ignored when using v-model. Declare initial values in the component's data option instead.
[Vue warn]: <input v-model="item.productQuentity" value="0">:
inline value attributes will be ignored when using v-model. Declare initial values in the component's data option instead.
2017-02-12
Uncaught (in promise) Responsebody: Objectmessage: "1111"result: Objectstatus: 1__proto__: ObjectbodyBlob: BlobbodyText: PromiseObjdata: (...)headers: Headersok: falsestatus: 0statusText: ""url: "data/cartData.json"get data: get()set data: set(body)__proto__: Object 这个不知道哪的错,大家帮我看看
2017-02-10
添加两个计算属性,设置如果价格是0,就不能结账。大于0,才可以点击和跳转。
<a :href="toLink" class="danger" :class="{'disabled':isEmpty}" >结账</a>
<a :href="toLink" class="danger" :class="{'disabled':isEmpty}" >结账</a>
2017-02-10
深受启发,以前自己看了文档,但重来不动手,现在跟着老师练,感觉进步飞快。希望自己以后有一天也能像老师一样,开自己的课,传播知识给其他小伙伴
2017-02-10
老师的代码有一处错误,删除商品的时候,var index = this.productList.indexOf(this.curProduct);这一句其实是无法取到对应的索引的,因为都是对象,之所以看起来成功了,是因为 index == -1,而数组中恰好只有两个元素
2017-02-10