1212 [!states.iconContainer && !states.text, n(`--${states.type}`)],
1313 [states.text, `${n('--text')} ${n(`--text-${states.type}`)}`],
1414 [states.iconContainer, n(`--icon-container-${states.type}`)],
15+ [states.filledDefault, n('--filled-default')],
1516 [round, n('--round')],
1617 [states.outline, n('--outline')],
1718 [loading || pending, n('--loading')],
5253</template >
5354
5455<script lang="ts">
55- import { call , normalizeToArray } from ' @varlet/shared'
56+ import { call , normalizeToArray , toNumber } from ' @varlet/shared'
5657import { computed , defineComponent , ref } from ' vue'
5758import Hover from ' ../hover'
5859import VarHoverOverlay , { useHoverOverlay } from ' ../hover-overlay'
@@ -64,6 +65,10 @@ import { useButtonGroup } from './provide'
6465
6566const { name, n, classes } = createNamespace (' button' )
6667
68+ function isFilledElevation(elevation : boolean | number | string ) {
69+ return elevation === false || toNumber (elevation ) === 0
70+ }
71+
6772export default defineComponent ({
6873 name ,
6974 components: {
@@ -88,10 +93,17 @@ export default defineComponent({
8893 textColor: props .textColor ,
8994 outline: props .outline ,
9095 iconContainer: props .tonal || props .iconContainer ,
96+ filledDefault:
97+ (props .type == null || props .type === ' default' ) &&
98+ isFilledElevation (props .elevation ) &&
99+ ! props .text &&
100+ ! props .outline &&
101+ ! props .tonal &&
102+ ! props .iconContainer ,
91103 }
92104 }
93105
94- const { type, size, color, textColor, mode } = buttonGroup
106+ const { type, size, color, textColor, mode, elevation } = buttonGroup
95107
96108 return {
97109 elevation: ' ' ,
@@ -102,6 +114,8 @@ export default defineComponent({
102114 text: mode .value === ' text' || mode .value === ' outline' ,
103115 outline: mode .value === ' outline' ,
104116 iconContainer: mode .value === ' tonal' || mode .value === ' icon-container' ,
117+ filledDefault:
118+ mode .value === ' normal' && (props .type ?? type .value ) === ' default' && isFilledElevation (elevation .value ),
105119 }
106120 })
107121
0 commit comments