|
2 | 2 | <component
|
3 | 3 | :is="element"
|
4 | 4 | :href="href"
|
5 |
| - class="inline-flex !no-underline select-none justify-center items-center gap-2 py-2.5 relative overflow-hidden rounded-full" |
| 5 | + class="mv-inline-flex !mv-no-underline mv-select-none mv-justify-center mv-items-center mv-gap-2 mv-py-2.5 mv-relative mv-overflow-hidden mv-rounded-full" |
6 | 6 | :class="[
|
7 | 7 | paddingX,
|
8 | 8 | {
|
9 |
| - 'border-solid border !border-[--md-sys-color-outline]': |
| 9 | + 'mv-border-solid mv-border !mv-border-[--md-sys-color-outline]': |
10 | 10 | variant === 'outlined',
|
11 |
| - 'pointer-events-none': disabled, |
| 11 | + 'mv-pointer-events-none': disabled, |
12 | 12 | },
|
13 | 13 | ]"
|
14 | 14 | :style="[textColor, backgroundColor]"
|
15 | 15 | >
|
16 |
| - <MStateLayer :background="stateBackground" :disabled="disabled" /> |
| 16 | + <MStateLayer |
| 17 | + :background="stateBackground" |
| 18 | + :disabled="disabled" |
| 19 | + @click="$emit('click')" |
| 20 | + /> |
17 | 21 | <span
|
18 | 22 | v-if="prependIcon"
|
19 |
| - class="material-symbols-rounded text-[18px]" |
| 23 | + class="material-symbols-rounded mv-text-[18px]" |
20 | 24 | v-text="prependIcon"
|
21 | 25 | />
|
22 |
| - <span class="label-large lowercase first-letter:uppercase" v-text="text" /> |
| 26 | + <span |
| 27 | + class="label-large mv-lowercase first-letter:mv-uppercase" |
| 28 | + v-text="text" |
| 29 | + /> |
23 | 30 | <span
|
24 | 31 | v-if="appendIcon"
|
25 |
| - class="material-symbols-rounded text-[18px]" |
| 32 | + class="material-symbols-rounded mv-text-[18px]" |
26 | 33 | v-text="appendIcon"
|
27 | 34 | />
|
28 | 35 | </component>
|
@@ -56,21 +63,23 @@ const props = defineProps({
|
56 | 63 | },
|
57 | 64 | })
|
58 | 65 |
|
| 66 | +defineEmits(['click']) |
| 67 | +
|
59 | 68 | const element = computed(() => {
|
60 | 69 | return h(props.href ? 'a' : 'button', {})
|
61 | 70 | })
|
62 | 71 |
|
63 | 72 | const paddingX = computed(() => {
|
64 | 73 | if (props.variant === 'text' && props.icon == null)
|
65 | 74 | return (
|
66 |
| - 'px-3 ' + |
67 |
| - (props.prependIcon ? 'pr-4 ' : '') + |
68 |
| - (props.appendIcon ? 'pl-4' : '') |
| 75 | + 'mv-px-3 ' + |
| 76 | + (props.prependIcon ? 'mv-pr-4 ' : '') + |
| 77 | + (props.appendIcon ? 'mv-pl-4' : '') |
69 | 78 | )
|
70 | 79 | return (
|
71 |
| - 'px-6 ' + |
72 |
| - (props.prependIcon ? 'pl-4 ' : '') + |
73 |
| - (props.appendIcon ? 'pr-4' : '') |
| 80 | + 'mv-px-6 ' + |
| 81 | + (props.prependIcon ? 'mv-pl-4 ' : '') + |
| 82 | + (props.appendIcon ? 'mv-pr-4' : '') |
74 | 83 | )
|
75 | 84 | })
|
76 | 85 |
|
|
0 commit comments