From 51f41abc4bb77e5d5ddaa1e1f2a23a2a84068d71 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 2 Oct 2024 15:06:39 +0700 Subject: [PATCH] refactor: component dialog, select input, select zone, tree view --- src/components/DialogForm.vue | 2 +- src/components/shared/SelectInput.vue | 22 +++++++--- src/components/shared/SelectZone.vue | 60 ++++++++++++++++++++------- src/components/shared/TreeView.vue | 48 ++++++++++++++++++++- 4 files changed, 109 insertions(+), 23 deletions(-) diff --git a/src/components/DialogForm.vue b/src/components/DialogForm.vue index 2d8e7abb..510a18ab 100644 --- a/src/components/DialogForm.vue +++ b/src/components/DialogForm.vue @@ -45,7 +45,7 @@ const currentTab = defineModel('currentTab'); :model-value="modal" @update:model-value="(v) => (modal = beforeClose ? beforeClose() : v)" @before-show="show" - @hide="hideCloseEvent !== undefined && hideCloseEvent ? '' : close" + @hide="hideCloseEvent !== undefined && hideCloseEvent ? '' : close?.()" >
[]; optionLabel?: string; optionValue?: string; + placeholder?: string; + hideSelected?: boolean; readonly?: boolean; clearable?: boolean; incremental?: boolean; + fillInput?: boolean; rules?: ((value: string) => string | true)[]; }>(), - { option: () => [], optionLabel: 'label', optionValue: 'value' }, + { + option: () => [], + optionLabel: 'label', + optionValue: 'value', + hideSelected: true, + fillInput: true, + }, ); defineEmits<{ @@ -53,14 +62,15 @@ watch(