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>
写回答

1回答

Sam

2019-08-06

hi,这个警告是建议你把v-for中的categoryList换成computed计算属性

0
5
Sam
回复
whis_per
好的~非常棒
2019-08-07
共5条回复

Vue 实战商业级读书Web APP完整项目

Vue全家桶+最新前端技术+前后端分离架构,完整项目流程

1621 学习 · 1951 问题

查看课程