Antd-Vue插槽内属性修改

antd-vue table scopedSlots

scopedSlots插槽内属性修改

如下我想要根据状态来控制插槽内a标签点击与不可点击的切换

<span slot="operation"  slot-scope="text, record">
	<a @click="handleWarehousing(record)" v-has="'ewm:warehousing'" :disabled="toggleDisabled">入库</a>
</span>

最初是打算定义toggleDisabled临时参数来控制,但是没有生效
解决方法:利用record获取status来改变插槽内的属性

<span slot="operation"  slot-scope="text, record">
	<a @click="handleWarehousing(record)" v-has="'ewm:warehousing'" :disabled="record.status == '1' ? true:false">入库</a>
</span>
效果

image

posted @ 2022-04-14 12:44  你滴风  阅读(268)  评论(0编辑  收藏  举报