Skip to content

Commit

Permalink
fix(popconfirm-button): remove button excess title
Browse files Browse the repository at this point in the history
移除PopconfirmButton组件多余的title;修改TableAction的tooltip默认位置
  • Loading branch information
mynetfan committed Jul 2, 2021
1 parent 5fab267 commit 73654b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/src/PopConfirmButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
return () => {
const bindValues = omit(unref(getBindValues), 'icon');
const Button = h(BasicButton, bindValues, extendSlots(slots));
const Button = h(BasicButton, omit(bindValues, 'title'), extendSlots(slots));
// If it is not enabled, it is a normal button
if (!props.enable) {
Expand Down
14 changes: 6 additions & 8 deletions src/components/Table/src/components/TableAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
<Tooltip v-bind="getTooltip(action.tooltip)">
<PopConfirmButton v-bind="action">
<Tooltip v-bind="getTooltip(action.tooltip)">
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" />
{{ action.label }}
</Tooltip>
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" />
{{ action.label }}
</PopConfirmButton>
</Tooltip>
<Divider
Expand Down Expand Up @@ -35,7 +33,7 @@
<script lang="ts">
import { defineComponent, PropType, computed, toRaw } from 'vue';
import { MoreOutlined } from '@ant-design/icons-vue';
import { Divider, Tooltip } from 'ant-design-vue';
import { Divider, Tooltip, TooltipProps } from 'ant-design-vue';
import Icon from '/@/components/Icon/index';
import { ActionItem, TableActionType } from '/@/components/Table';
import { PopConfirmButton } from '/@/components/Button';
Expand Down Expand Up @@ -129,11 +127,11 @@
});
const getTooltip = computed(() => {
return (data) => {
return (data: string | TooltipProps): TooltipProps => {
if (isString(data)) {
return { title: data };
return { title: data, placement: 'bottom' };
} else {
return data;
return Object.assign({ placement: 'bottom' }, data);
}
};
});
Expand Down

0 comments on commit 73654b7

Please sign in to comment.