ShelfGroupDialog组件
来源:8-22 书架列表过渡动画开发

whis_per
2019-08-06
老师你好,我在复制ShelfGroupDialog.vue后,终端就会有警告,
error: The 'categoryList' variable inside 'v-for' directive should be replaced with a computed property that returns filtered array in
stead. You should not mix 'v-for' with 'v-if' (vue/no-use-v-if-with-v-for) at src\components\shelf\ShelfGroupDialog.vue:9:12:
7 | :key="index"
8 | @click="onGroupClick(item)"
> 9 | v-if="(item.edit === 2 && isInGroup) || item.edit !== 2 || !item.edit">
| ^
10 | <div class="dialog-list-item-text">{{item.title}}</div>
11 | <div class="dialog-list-icon-wrapper" v-if="category && item.id ? category.id === item.id : false">
12 | <span class="icon-check"></span>
还有,我的那个mock错误一直没有调好,https://coding.imooc.com/learn/questiondetail/135003.html,麻烦老师帮我调下,我实在没发现哪里错
写回答
1回答
-
Sam
2019-08-06
hi,这个警告是建议你把v-for中的categoryList换成computed计算属性
052019-08-07
相似问题
滚动组件的问题
回答 1
老师,关于scroll组件的问题
回答 1