From 4806aced85511a36fc90c38ae06934d432397dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=AE=89=E5=8D=81=E5=A4=A7=E6=9D=B0=E5=87=BA?= =?UTF-8?q?=E9=9D=92=E5=B9=B4?= <49261002+zdxzqwz@users.noreply.github.com> Date: Mon, 22 Nov 2021 09:15:50 +0800 Subject: [PATCH] Update TableAction.vue (#1394) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 解决TableAction组件Dropdown因为权限导致分割线显示错误的问题. --- .../Table/src/components/TableAction.vue | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index 0c882a1f..4c5c1ed9 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -104,21 +104,20 @@ }); const getDropdownList = computed((): any[] => { - return (toRaw(props.dropDownActions) || []) - .filter((action) => { - return hasPermission(action.auth) && isIfShow(action); - }) - .map((action, index) => { - const { label, popConfirm } = action; - return { - ...action, - ...popConfirm, - onConfirm: popConfirm?.confirm, - onCancel: popConfirm?.cancel, - text: label, - divider: index < props.dropDownActions.length - 1 ? props.divider : false, - }; - }); + const list = (toRaw(props.dropDownActions) || []).filter((action) => { + return hasPermission(action.auth) && isIfShow(action); + }); + return list.map((action, index) => { + const { label, popConfirm } = action; + return { + ...action, + ...popConfirm, + onConfirm: popConfirm?.confirm, + onCancel: popConfirm?.cancel, + text: label, + divider: index < list.length - 1 ? props.divider : false, + }; + }); }); const getAlign = computed(() => {