Добавлен лоадер при открытии модальных окон

This commit is contained in:
brusnitsyn
2025-12-19 09:00:14 +09:00
parent 0a1304e55b
commit b86cdaec90
2 changed files with 25 additions and 4 deletions

View File

@@ -1,5 +1,18 @@
<script setup>
import {NButton, NDatePicker, NDivider, NFlex, NForm, NFormItem, NInput, NModal, NSpace, NSwitch, NSelect} from "naive-ui";
import {
NButton,
NDatePicker,
NDivider,
NFlex,
NForm,
NFormItem,
NInput,
NModal,
NSpace,
NSwitch,
NSelect,
NSpin
} from "naive-ui";
import {ref, watch} from "vue";
import {router} from "@inertiajs/vue3";
const open = defineModel('open')
@@ -99,7 +112,7 @@ watch(() => props.archiveHistoryId, async (newId) => {
</script>
<template>
<NModal v-model:show="open" preset="card" class="max-w-2xl" closable @close="onCloseWithoutSave">
<NModal v-model:show="open" preset="card" class="max-w-2xl relative" closable @close="onCloseWithoutSave">
<template #header>
{{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи
</template>
@@ -140,6 +153,10 @@ watch(() => props.archiveHistoryId, async (newId) => {
</NSpace>
</NFlex>
</template>
<div v-show="loading" class="absolute inset-0 z-10 bg-white flex items-center justify-center">
<NSpin :show="true" />
</div>
</NModal>
</template>