Reparied Cancel Button
This commit is contained in:
@@ -54,21 +54,11 @@ const setupPage = async () => {
|
|||||||
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelEditorCreate = () => {
|
|
||||||
if(itemInfo.value) {
|
|
||||||
router.push(`/contacts/show/${itemInfo.value.id}`)
|
|
||||||
} else {
|
|
||||||
router.push(`/contacts`)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar
|
<UDashboardNavbar
|
||||||
:title="itemInfo ? itemInfo.fullName : (mode === 'create' ? 'Ansprechpartner erstellen' : 'Ansprechpartner bearbeiten')"
|
|
||||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
>
|
>
|
||||||
<template #left>
|
<template #left>
|
||||||
@@ -84,7 +74,7 @@ setupPage()
|
|||||||
<h1
|
<h1
|
||||||
v-if="itemInfo"
|
v-if="itemInfo"
|
||||||
:class="['text-xl','font-medium', ... itemInfo.active ? ['text-primary'] : ['text-rose-500']]"
|
:class="['text-xl','font-medium', ... itemInfo.active ? ['text-primary'] : ['text-rose-500']]"
|
||||||
>{{itemInfo ? `Ansprechpartner: ${itemInfo.fullName}` : (mode === 'create' ? 'Ansprechpartner erstellen' : 'Ansprechpartner bearbeiten')}}</h1>
|
>{{itemInfo.id ? `Ansprechpartner: ${itemInfo.fullName}` : (mode === 'create' ? 'Ansprechpartner erstellen' : 'Ansprechpartner bearbeiten')}}</h1>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
@@ -100,7 +90,7 @@ setupPage()
|
|||||||
Erstellen
|
Erstellen
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="cancelEditorCreate"
|
@click="router.push(itemInfo.id ? `/contacts/show/${itemInfo.value.id}` : `/contacts/`)"
|
||||||
color="red"
|
color="red"
|
||||||
class="ml-2"
|
class="ml-2"
|
||||||
v-if="mode === 'edit' || mode === 'create'"
|
v-if="mode === 'edit' || mode === 'create'"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ setupPage()
|
|||||||
<h1
|
<h1
|
||||||
v-if="itemInfo"
|
v-if="itemInfo"
|
||||||
:class="['text-xl','font-medium', ... itemInfo.active ? ['text-primary'] : ['text-rose-500']]"
|
:class="['text-xl','font-medium', ... itemInfo.active ? ['text-primary'] : ['text-rose-500']]"
|
||||||
>{{itemInfo ? `Kunde: ${itemInfo.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')}}</h1>
|
>{{itemInfo.id ? `Kunde: ${itemInfo.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')}}</h1>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
@@ -99,7 +99,7 @@ setupPage()
|
|||||||
Erstellen
|
Erstellen
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="itemInfo ? router.push(`/customers/show/${itemInfo.id}`) : router.push(`/customers`)"
|
@click="itemInfo.id ? router.push(`/customers/show/${itemInfo.id}`) : router.push(`/customers`)"
|
||||||
color="red"
|
color="red"
|
||||||
class="ml-2"
|
class="ml-2"
|
||||||
v-if="mode === 'edit' || mode === 'create'"
|
v-if="mode === 'edit' || mode === 'create'"
|
||||||
|
|||||||
Reference in New Issue
Block a user