feat: convert create-edit to script setup and ts

This commit is contained in:
Dominik Pschenitschni 2022-02-13 17:45:46 +01:00 committed by kolaente
parent 16d8c2224b
commit 0e14e3053d
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -30,7 +30,7 @@
<x-button <x-button
v-if="primaryLabel !== ''" v-if="primaryLabel !== ''"
variant="primary" variant="primary"
@click.prevent.stop="primary" @click.prevent.stop="primary()"
:icon="primaryIcon" :icon="primaryIcon"
:disabled="primaryDisabled" :disabled="primaryDisabled"
> >
@ -42,7 +42,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { i18n } from '@/i18n' import { useI18n } from 'vue-i18n'
defineProps({ defineProps({
title: { title: {
@ -52,7 +52,8 @@ defineProps({
primaryLabel: { primaryLabel: {
type: String, type: String,
default() { default() {
return i18n.global.t('misc.create') const {t} = useI18n()
return t('misc.create')
}, },
}, },
primaryIcon: { primaryIcon: {
@ -76,6 +77,7 @@ defineProps({
default: false, default: false,
}, },
}) })
const emit = defineEmits(['create', 'primary', 'tertiary']) const emit = defineEmits(['create', 'primary', 'tertiary'])
function primary() { function primary() {