请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Unexpected side effect in "listShow" computed property

https://img1.sycdn.imooc.com//szimg/5b6564c000017fc011380882.jpg

https://img1.sycdn.imooc.com//szimg/5b6564c2000120df15921210.jpg

文件中listShow()

listShow() {    

       if (!this.totalCount) {    

         this.fold = true;    

         return false;    

       }    

       let show = !this.fold;    

       if (show) {    

         this.$nextTick(() => {    

           if (!this.scroll) {    

             this.scroll = new BScroll(this.$refs.listContent, {    

               click: true    

             });    

           } else {    

             this.scroll.refresh();    

           }    

         });    

       }    

       return show;    

     }    

   }

报错了,不知道哪里出问题了,怎么解决呢?求指教


正在回答 回答被采纳积分+3

1回答

ustbhuangyi 2018-08-05 00:55:25

这是新版 Vue.js 的报警,不要在计算属性中做赋值操作, 可以尝试用 watch 来实现类似的逻辑

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号