<span v-if="scope.row.status==40">
    打回修改
</span>
<span v-else v-for="item in dict" v-if="item.code*1 === scope.row.status">
    {{item.mark}}
</span>

以上代码,运行控制台报错:Failed to resolve directive: else

原因:永远不要把 v-if 和 v-for 同时用在同一个元素上

官方说明:

https://cn.vuejs.org/v2/style-guide/#%E9%81%BF%E5%85%8D-v-if-%E5%92%8C-v-for-%E7%94%A8%E5%9C%A8%E4%B8%80%E8%B5%B7%E5%BF%85%E8%A6%81

Logo

前往低代码交流专区

更多推荐