feat: dialog headers

This commit is contained in:
opbnq-q
2025-03-10 07:40:34 -07:00
parent d7535622e4
commit ab5851babc
2 changed files with 6 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ const props = defineProps<{
validate: Validate<T>
items: T[]
load(): Promise<T[]>
name?: string
}>()
type Key = keyof T
@@ -64,6 +65,9 @@ async function handleSave() {
<template>
<Dialog v-model:visible="showCreate">
<template #header>
<h1>{{ props.updateMode ? 'Изменить' : 'Создать' }} {{ props.name?.toLowerCase() }}</h1>
</template>
<div class="flex flex-col justify-start gap-5 min-h-[40vh]">
<div v-for="key in keys" v-show="!props.scheme[key].hidden && !props.scheme[key].readonly"
class="flex items-center gap-5">

View File

@@ -80,6 +80,7 @@ watch(() => props.items, () => {
<template>
<DialogWindow
:name
:load
:items
:validate
@@ -99,6 +100,7 @@ watch(() => props.items, () => {
</template>
</DialogWindow>
<DialogWindow
:name
:load
:items
:validate