|
@@ -5,7 +5,10 @@
|
|
<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>
|
|
- <Divider type="vertical" v-if="divider && index < getActions.length" />
|
|
|
|
|
|
+ <Divider
|
|
|
|
+ type="vertical"
|
|
|
|
+ v-if="divider && index < getActions.length - (dropDownActions ? 0 : 1)"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
<Dropdown :trigger="['hover']" :dropMenuList="getDropList" v-if="dropDownActions">
|
|
<Dropdown :trigger="['hover']" :dropMenuList="getDropList" v-if="dropDownActions">
|
|
<slot name="more" />
|
|
<slot name="more" />
|
|
@@ -44,17 +47,31 @@
|
|
},
|
|
},
|
|
setup(props) {
|
|
setup(props) {
|
|
const { prefixCls } = useDesign('basic-table-action');
|
|
const { prefixCls } = useDesign('basic-table-action');
|
|
- let table = {};
|
|
|
|
|
|
+ let table: Partial<TableActionType> = {};
|
|
if (!props.outside) {
|
|
if (!props.outside) {
|
|
table = useTableContext();
|
|
table = useTableContext();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // const getSize = computed(() => {
|
|
|
|
+ // const size = table?.getSize?.();
|
|
|
|
+ // if (size === 'middle' || !size) {
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // if (size === 'default') {
|
|
|
|
+ // return 'large';
|
|
|
|
+ // }
|
|
|
|
+ // return size;
|
|
|
|
+ // });
|
|
|
|
+
|
|
const getActions = computed(() => {
|
|
const getActions = computed(() => {
|
|
return (props.actions || []).map((action) => {
|
|
return (props.actions || []).map((action) => {
|
|
const { popConfirm } = action;
|
|
const { popConfirm } = action;
|
|
|
|
+ // const size = unref(getSize);
|
|
return {
|
|
return {
|
|
type: 'link',
|
|
type: 'link',
|
|
size: 'small',
|
|
size: 'small',
|
|
|
|
+ // ...(size ? { size } : {}),
|
|
...action,
|
|
...action,
|
|
...(popConfirm || {}),
|
|
...(popConfirm || {}),
|
|
onConfirm: popConfirm?.confirm,
|
|
onConfirm: popConfirm?.confirm,
|