Commit 73654b7862c59d623d6d5dc7dcf6ff2704564d9a
1 parent
5fab267a
fix(popconfirm-button): remove button excess `title`
移除PopconfirmButton组件多余的title;修改TableAction的tooltip默认位置
Showing
2 changed files
with
7 additions
and
9 deletions
src/components/Button/src/PopConfirmButton.vue
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | 41 | ||
42 | return () => { | 42 | return () => { |
43 | const bindValues = omit(unref(getBindValues), 'icon'); | 43 | const bindValues = omit(unref(getBindValues), 'icon'); |
44 | - const Button = h(BasicButton, bindValues, extendSlots(slots)); | 44 | + const Button = h(BasicButton, omit(bindValues, 'title'), extendSlots(slots)); |
45 | 45 | ||
46 | // If it is not enabled, it is a normal button | 46 | // If it is not enabled, it is a normal button |
47 | if (!props.enable) { | 47 | if (!props.enable) { |
src/components/Table/src/components/TableAction.vue
@@ -3,10 +3,8 @@ | @@ -3,10 +3,8 @@ | ||
3 | <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> | 3 | <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> |
4 | <Tooltip v-bind="getTooltip(action.tooltip)"> | 4 | <Tooltip v-bind="getTooltip(action.tooltip)"> |
5 | <PopConfirmButton v-bind="action"> | 5 | <PopConfirmButton v-bind="action"> |
6 | - <Tooltip v-bind="getTooltip(action.tooltip)"> | ||
7 | - <Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> | ||
8 | - {{ action.label }} | ||
9 | - </Tooltip> | 6 | + <Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
7 | + {{ action.label }} | ||
10 | </PopConfirmButton> | 8 | </PopConfirmButton> |
11 | </Tooltip> | 9 | </Tooltip> |
12 | <Divider | 10 | <Divider |
@@ -35,7 +33,7 @@ | @@ -35,7 +33,7 @@ | ||
35 | <script lang="ts"> | 33 | <script lang="ts"> |
36 | import { defineComponent, PropType, computed, toRaw } from 'vue'; | 34 | import { defineComponent, PropType, computed, toRaw } from 'vue'; |
37 | import { MoreOutlined } from '@ant-design/icons-vue'; | 35 | import { MoreOutlined } from '@ant-design/icons-vue'; |
38 | - import { Divider, Tooltip } from 'ant-design-vue'; | 36 | + import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'; |
39 | import Icon from '/@/components/Icon/index'; | 37 | import Icon from '/@/components/Icon/index'; |
40 | import { ActionItem, TableActionType } from '/@/components/Table'; | 38 | import { ActionItem, TableActionType } from '/@/components/Table'; |
41 | import { PopConfirmButton } from '/@/components/Button'; | 39 | import { PopConfirmButton } from '/@/components/Button'; |
@@ -129,11 +127,11 @@ | @@ -129,11 +127,11 @@ | ||
129 | }); | 127 | }); |
130 | 128 | ||
131 | const getTooltip = computed(() => { | 129 | const getTooltip = computed(() => { |
132 | - return (data) => { | 130 | + return (data: string | TooltipProps): TooltipProps => { |
133 | if (isString(data)) { | 131 | if (isString(data)) { |
134 | - return { title: data }; | 132 | + return { title: data, placement: 'bottom' }; |
135 | } else { | 133 | } else { |
136 | - return data; | 134 | + return Object.assign({ placement: 'bottom' }, data); |
137 | } | 135 | } |
138 | }; | 136 | }; |
139 | }); | 137 | }); |