![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
总结
白露凝微霜
这个作者很懒,什么都没留下…
展开
-
VUE+vant-ui电商项目 购物车页面,修改数组中的值后发现页面没有同步渲染
最近用vant-ui+vue做了一个电商APP,在做购物车页面checkBox时发现,点击checkBox绑定的值变了,但页面没有同步刷新,最后的解决方案如下: 1.利用map返回新数组 this.cartInfo = this.cartInfo.map( item => { item.isCheck = this.orderChecked; item.goods = item.goods.ma原创 2021-04-08 13:38:56 · 468 阅读 · 1 评论 -
前端处理数据的几种方法
前端在渲染页面时,通常会涉及到拿到的数据进行处理。这里介绍几种简单的数据处理方法。 1.去重 newArr(arr){ // 去重 return Array.from(new Set(arr)) } 2.字符串切割 例:后端传过来的图片路径:“img1.png,img2.png,img3.png,” 转成[http://172.17.6.214/img1.png,http://172.17.6.214/img2.png,http://172原创 2021-04-07 17:43:38 · 1607 阅读 · 0 评论