Commit 4806aced85511a36fc90c38ae06934d432397dc9

Authored by 西安十大杰出青年
Committed by GitHub
1 parent 3b3f6c90

Update TableAction.vue (#1394)

fix: 解决TableAction组件Dropdown因为权限导致分割线显示错误的问题.
src/components/Table/src/components/TableAction.vue
@@ -104,21 +104,20 @@ @@ -104,21 +104,20 @@
104 }); 104 });
105 105
106 const getDropdownList = computed((): any[] => { 106 const getDropdownList = computed((): any[] => {
107 - return (toRaw(props.dropDownActions) || [])  
108 - .filter((action) => {  
109 - return hasPermission(action.auth) && isIfShow(action);  
110 - })  
111 - .map((action, index) => {  
112 - const { label, popConfirm } = action;  
113 - return {  
114 - ...action,  
115 - ...popConfirm,  
116 - onConfirm: popConfirm?.confirm,  
117 - onCancel: popConfirm?.cancel,  
118 - text: label,  
119 - divider: index < props.dropDownActions.length - 1 ? props.divider : false,  
120 - };  
121 - }); 107 + const list = (toRaw(props.dropDownActions) || []).filter((action) => {
  108 + return hasPermission(action.auth) && isIfShow(action);
  109 + });
  110 + return list.map((action, index) => {
  111 + const { label, popConfirm } = action;
  112 + return {
  113 + ...action,
  114 + ...popConfirm,
  115 + onConfirm: popConfirm?.confirm,
  116 + onCancel: popConfirm?.cancel,
  117 + text: label,
  118 + divider: index < list.length - 1 ? props.divider : false,
  119 + };
  120 + });
122 }); 121 });
123 122
124 const getAlign = computed(() => { 123 const getAlign = computed(() => {