Skip to content

Commit

Permalink
fix: button default variant
Browse files Browse the repository at this point in the history
  • Loading branch information
daief committed Feb 15, 2023
1 parent 461b28b commit 1377fe7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const buttonProps = {
},
shape: {
type: String as PropType<IButtonShape>,
default: 'neutral',
default: '',
},
size: {
type: String as PropType<ISize>,
Expand Down Expand Up @@ -73,16 +73,19 @@ export const Button = componentV2<
);

const cls = computed(() => {
let variantCls = '';
if (props.variant === 'glass') {
variantCls = 'dv-glass';
} else if (props.variant) {
variantCls =
props.variant !== 'neutral' ? `dv-btn-${props.variant}` : '';
}
return [
'dv-btn',
props.variant === 'glass'
? 'dv-glass'
: !!props.variant
? `dv-btn-${props.variant}`
: '',
variantCls,
{
[`dv-btn-${size.value}`]: true,
[`dv-btn-${shape.value}`]: true,
[`dv-btn-${shape.value}`]: !!shape.value,
'dv-btn-block': props.block,
'dv-btn-wide': props.wide,
'dv-loading': finalLoading.value,
Expand Down

0 comments on commit 1377fe7

Please sign in to comment.