fix(table-action): fixed icon margin without label

修复当没有label时,icon没有在按钮内居中的问题
This commit is contained in:
无木 2021-07-15 14:36:40 +08:00
parent 4b46a84c2b
commit dc51e6a8d4

View File

@ -3,13 +3,23 @@
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
<PopConfirmButton v-bind="action">
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" />
{{ action.label }}
<Icon
:icon="action.icon"
:class="{ 'mr-1': action.label }"
:style="{ margin: action.label ? '' : 'auto !important' }"
v-if="action.icon"
/>
<template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton>
</Tooltip>
<PopConfirmButton v-else v-bind="action">
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" />
{{ action.label }}
<Icon
:icon="action.icon"
:class="{ 'mr-1': action.label }"
:style="{ margin: action.label ? '' : 'auto !important' }"
v-if="action.icon"
/>
<template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton>
<Divider
type="vertical"