Unverified 提交 4806aced 作者: 西安十大杰出青年 提交者: GitHub

Update TableAction.vue (#1394)

fix: 解决TableAction组件Dropdown因为权限导致分割线显示错误的问题.
上级 3b3f6c90
...@@ -104,21 +104,20 @@ ...@@ -104,21 +104,20 @@
}); });
const getDropdownList = computed((): any[] => { const getDropdownList = computed((): any[] => {
return (toRaw(props.dropDownActions) || []) const list = (toRaw(props.dropDownActions) || []).filter((action) => {
.filter((action) => { return hasPermission(action.auth) && isIfShow(action);
return hasPermission(action.auth) && isIfShow(action); });
}) return list.map((action, index) => {
.map((action, index) => { const { label, popConfirm } = action;
const { label, popConfirm } = action; return {
return { ...action,
...action, ...popConfirm,
...popConfirm, onConfirm: popConfirm?.confirm,
onConfirm: popConfirm?.confirm, onCancel: popConfirm?.cancel,
onCancel: popConfirm?.cancel, text: label,
text: label, divider: index < list.length - 1 ? props.divider : false,
divider: index < props.dropDownActions.length - 1 ? props.divider : false, };
}; });
});
}); });
const getAlign = computed(() => { const getAlign = computed(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论