From 9c2f3f30bbd8abcccc4f256183ed7794da7fcda2 Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期四, 31 十二月 2020 21:24:47 +0800 Subject: [PATCH] refactor(table): refactor table #150 #148 #146 #130 #76 --- src/components/Table/src/components/TableAction.vue | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index 5ff4d90..fb577d4 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -1,14 +1,13 @@ <template> <div :class="[prefixCls, getAlign]"> - <template v-for="(action, index) in getActions" :key="`${index}`"> + <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> <PopConfirmButton v-bind="action"> <Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> {{ action.label }} </PopConfirmButton> <Divider type="vertical" v-if="divider && index < getActions.length" /> </template> - - <Dropdown :trigger="['hover']" :dropMenuList="getDropList"> + <Dropdown :trigger="['hover']" :dropMenuList="getDropList" v-if="dropDownActions"> <slot name="more" /> <a-button type="link" size="small" v-if="!$slots.more"> <MoreOutlined class="icon-more" /> @@ -61,7 +60,7 @@ }); const getDropList = computed(() => { - return props.dropDownActions.map((action, index) => { + return (props.dropDownActions || []).map((action, index) => { const { label } = action; return { ...action, -- Gitblit v1.8.0