feat: type defineEmits for CreateEdit
This commit is contained in:
parent
c9591fe464
commit
098c99fd2e
@ -22,7 +22,7 @@
|
|||||||
v-if="tertiary !== ''"
|
v-if="tertiary !== ''"
|
||||||
:shadow="false"
|
:shadow="false"
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
@click.prevent.stop="$emit('tertiary')"
|
@click.prevent.stop="$emit('tertiary', $event)"
|
||||||
>
|
>
|
||||||
{{ tertiary }}
|
{{ tertiary }}
|
||||||
</x-button>
|
</x-button>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
:icon="primaryIcon"
|
:icon="primaryIcon"
|
||||||
:disabled="primaryDisabled || loading"
|
:disabled="primaryDisabled || loading"
|
||||||
class="ml-2"
|
class="ml-2"
|
||||||
@click.prevent.stop="primary()"
|
@click.prevent.stop="primary"
|
||||||
>
|
>
|
||||||
{{ primaryLabel || $t('misc.create') }}
|
{{ primaryLabel || $t('misc.create') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
@ -70,10 +70,14 @@ withDefaults(defineProps<{
|
|||||||
loading: false,
|
loading: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['create', 'primary', 'tertiary'])
|
const emit = defineEmits<{
|
||||||
|
'create': [event: MouseEvent],
|
||||||
|
'primary': [event: MouseEvent],
|
||||||
|
'tertiary': [event: MouseEvent]
|
||||||
|
}>()
|
||||||
|
|
||||||
function primary() {
|
function primary(event: MouseEvent) {
|
||||||
emit('create')
|
emit('create', event)
|
||||||
emit('primary')
|
emit('primary', event)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user