|
|
@ -1,12 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div :class="[prefixCls, getAlign]" @click="onCellClick"> |
|
|
<div :class="[prefixCls, getAlign]" @click="onCellClick"> |
|
|
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> |
|
|
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> |
|
|
<Tooltip v-bind="getTooltip(action.tooltip)"> |
|
|
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)"> |
|
|
<PopConfirmButton v-bind="action"> |
|
|
<PopConfirmButton v-bind="action"> |
|
|
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
|
|
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
|
|
{{ action.label }} |
|
|
{{ action.label }} |
|
|
</PopConfirmButton> |
|
|
</PopConfirmButton> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
|
|
|
<PopConfirmButton v-else v-bind="action"> |
|
|
|
|
|
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
|
|
|
|
|
{{ action.label }} |
|
|
|
|
|
</PopConfirmButton> |
|
|
<Divider |
|
|
<Divider |
|
|
type="vertical" |
|
|
type="vertical" |
|
|
class="action-divider" |
|
|
class="action-divider" |
|
|
@ -126,15 +130,13 @@ |
|
|
return actionColumn?.align ?? 'left'; |
|
|
return actionColumn?.align ?? 'left'; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const getTooltip = computed(() => { |
|
|
function getTooltip(data: string | TooltipProps): TooltipProps { |
|
|
return (data: string | TooltipProps): TooltipProps => { |
|
|
if (isString(data)) { |
|
|
if (isString(data)) { |
|
|
return { title: data, placement: 'bottom' }; |
|
|
return { title: data, placement: 'bottom' }; |
|
|
} else { |
|
|
} else { |
|
|
return Object.assign({ placement: 'bottom' }, data); |
|
|
return Object.assign({ placement: 'bottom' }, data); |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function onCellClick(e: MouseEvent) { |
|
|
function onCellClick(e: MouseEvent) { |
|
|
if (!props.stopButtonPropagation) return; |
|
|
if (!props.stopButtonPropagation) return; |
|
|
|