From 0c7fe16c0606e2fb8cd67378cecc274fd0816cf5 Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:40:08 +0800 Subject: [PATCH] fix(settings): show admin dropdown defaults --- open-isle-cli/src/components/BaseInput.vue | 4 ++++ open-isle-cli/src/components/Dropdown.vue | 26 +++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/open-isle-cli/src/components/BaseInput.vue b/open-isle-cli/src/components/BaseInput.vue index 5f2361adc..c42232633 100644 --- a/open-isle-cli/src/components/BaseInput.vue +++ b/open-isle-cli/src/components/BaseInput.vue @@ -61,6 +61,10 @@ export default { gap: 10px; } +.base-input:focus-within { + border-color: var(--primary-color); +} + .base-input-icon { opacity: 0.5; font-size: 16px; diff --git a/open-isle-cli/src/components/Dropdown.vue b/open-isle-cli/src/components/Dropdown.vue index db266d57e..f44964017 100644 --- a/open-isle-cli/src/components/Dropdown.vue +++ b/open-isle-cli/src/components/Dropdown.vue @@ -104,23 +104,29 @@ export default { } } + const loadOptions = async () => { + if (loaded.value) return + try { + loading.value = true + const res = await props.fetchOptions() + options.value = Array.isArray(res) ? res : [] + loaded.value = true + } catch { + options.value = [] + } finally { + loading.value = false + } + } + watch(open, async val => { if (val && !loaded.value) { - try { - loading.value = true - const res = await props.fetchOptions() - options.value = Array.isArray(res) ? res : [] - loaded.value = true - } catch { - options.value = [] - } finally { - loading.value = false - } + await loadOptions() } }) onMounted(() => { document.addEventListener('click', clickOutside) + loadOptions() }) onBeforeUnmount(() => {