feat: VerticalButtonGroup style
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ButtonGroup } from 'ant-design-vue';
|
||||
|
||||
import { Space } from 'ant-design-vue';
|
||||
/**
|
||||
* 垂直按钮组
|
||||
* Ant Design Vue 的按钮组只支持水平显示,通过重写样式实现垂直布局
|
||||
@@ -9,31 +8,9 @@ defineOptions({ name: 'VerticalButtonGroup' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ButtonGroup v-bind="$attrs" class="!inline-flex !flex-col">
|
||||
<slot></slot>
|
||||
</ButtonGroup>
|
||||
<Space v-bind="$attrs">
|
||||
<Space.Compact direction="vertical">
|
||||
<slot></slot>
|
||||
</Space.Compact>
|
||||
</Space>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
// TODO @AI:圆角的样式不太对!
|
||||
.ant-btn-group > :deep(.ant-btn:first-child) {
|
||||
border-bottom-color: transparent;
|
||||
border-radius: hsl(var(--radius)) hsl(var(--radius)) 0 0;
|
||||
}
|
||||
|
||||
.ant-btn-group > :deep(.ant-btn:last-child) {
|
||||
border-top-color: transparent;
|
||||
border-radius: 0 0 hsl(var(--radius)) hsl(var(--radius));
|
||||
}
|
||||
|
||||
.ant-btn-group :deep(.ant-btn:not(:first-child):not(:last-child)) {
|
||||
border-top-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.ant-btn-group > :deep(.ant-btn:not(:last-child)) {
|
||||
margin-right: 0;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user