Skip to content

Commit a2ce4e7

Browse files
committed
style(switch): 调整lg尺寸的相关样式
1 parent 2b83ea4 commit a2ce4e7

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

packages/devui-vue/devui/switch/src/switch.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@
7575

7676
&.#{$devui-prefix}-switch--lg {
7777
width: 58px;
78-
height: 30px;
78+
height: 28px;
7979

8080
.#{$devui-prefix}-switch__inner-wrapper {
8181
padding-left: 28px;
82+
padding-top: 2px;
8283
font-size: $devui-font-size-modal-title;
8384
}
8485

@@ -88,21 +89,21 @@
8889
}
8990

9091
& small {
91-
width: 28px;
92-
height: 28px;
92+
width: 26px;
93+
height: 26px;
9394
top: 1px;
9495
left: 1px;
9596
}
9697

9798
&.#{$devui-prefix}-switch--checked small {
9899
background: $devui-light-text;
99-
left: 29px;
100+
left: 30px;
100101
}
101102
}
102103

103104
&.#{$devui-prefix}-switch--sm {
104105
width: 30px;
105-
height: 14px;
106+
height: 15px;
106107

107108
.#{$devui-prefix}-switch__inner-wrapper {
108109
padding-left: 12px;

packages/devui-vue/docs/components/switch/index.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,27 @@ export default defineComponent({
7676
```vue
7777
<template>
7878
<div style="display: flex;">
79-
<d-switch v-model="checkedSmContent" size="sm">
80-
<template #checkedContent>开</template>
81-
<template #uncheckedContent>关</template>
82-
</d-switch>
8379
<d-switch class="mr-1" v-model="checkedColor" color="#FECC55"></d-switch>
84-
<d-switch class="mr-1" v-model="checkedContent">
85-
<template #checkedContent>开</template>
86-
<template #uncheckedContent>关</template>
87-
</d-switch>
8880
<d-switch class="mr-1" color="#50D4AB" v-model="checkedIcon">
8981
<template #checkedContent>
9082
<i class="icon-right"></i>
9183
</template>
9284
<template #uncheckedContent>
9385
<i class="icon-error"></i>
9486
</template>
95-
</d-switch>
87+
</d-switch>
88+
<d-switch v-model="checkedSmContent" size="sm">
89+
<template #checkedContent>开</template>
90+
<template #uncheckedContent>关</template>
91+
</d-switch>
92+
<d-switch v-model="checkedContent">
93+
<template #checkedContent>开</template>
94+
<template #uncheckedContent>关</template>
95+
</d-switch>
96+
<d-switch v-model="checkedLgContent" size="lg">
97+
<template #checkedContent>开</template>
98+
<template #uncheckedContent>关</template>
99+
</d-switch>
96100
</div>
97101
98102
</template>
@@ -104,11 +108,13 @@ export default defineComponent({
104108
const checkedColor = ref(true);
105109
const checkedContent = ref(false);
106110
const checkedSmContent = ref(false);
111+
const checkedLgContent = ref(false);
107112
const checkedIcon = ref(true);
108113
return {
109114
checkedColor,
110115
checkedContent,
111116
checkedSmContent,
117+
checkedLgContent,
112118
checkedIcon,
113119
};
114120
},

0 commit comments

Comments
 (0)