fix undefined

This commit is contained in:
Chuck1sn
2025-06-09 16:03:28 +08:00
parent db02af8677
commit 45c921fa24
10 changed files with 61 additions and 44 deletions

View File

@@ -289,22 +289,30 @@ onMounted(async () => {
initFlowbite();
const $upsertModalElement: HTMLElement | null =
document.querySelector("#user-upsert-modal");
userUpsertModal.value = new Modal($upsertModalElement, {});
if ($upsertModalElement) {
userUpsertModal.value = new Modal($upsertModalElement, {});
}
const $userDeleteModalElement: HTMLElement | null =
document.querySelector("#user-delete-modal");
userDeleteModal.value = new Modal(
$userDeleteModalElement,
{},
{
id: "user-delete-modal",
},
);
if ($userDeleteModalElement) {
userDeleteModal.value = new Modal(
$userDeleteModalElement,
{},
{
id: "user-delete-modal",
},
);
}
const $departmentDeleteModalElement: HTMLElement | null =
document.querySelector("#department-delete-modal");
departmentDeleteModal.value = new Modal($departmentDeleteModalElement, {});
if ($departmentDeleteModalElement) {
departmentDeleteModal.value = new Modal($departmentDeleteModalElement, {});
}
const $departmentUpsertModalElement: HTMLElement | null =
document.querySelector("#department-upsert-modal");
departmentUpsertModal.value = new Modal($departmentUpsertModalElement, {});
if ($departmentUpsertModalElement) {
departmentUpsertModal.value = new Modal($departmentUpsertModalElement, {});
}
});
</script>