Browse Source
Update TableAction.vue (#1394)
fix: 解决TableAction组件Dropdown因为权限导致分割线显示错误的问题.
pull/1397/head
西安十大杰出青年
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
14 additions and
15 deletions
-
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(() => { |
|
|
|
|