mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-21 20:16:13 +00:00
Merge pull request #113 from nagisa77/codex/update-dropdowns-on-settings-page
Fix admin dropdown defaults & input focus style
This commit is contained in:
@@ -61,6 +61,10 @@ export default {
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.base-input:focus-within {
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
.base-input-icon {
|
.base-input-icon {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
@@ -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 => {
|
watch(open, async val => {
|
||||||
if (val && !loaded.value) {
|
if (val && !loaded.value) {
|
||||||
try {
|
await loadOptions()
|
||||||
loading.value = true
|
|
||||||
const res = await props.fetchOptions()
|
|
||||||
options.value = Array.isArray(res) ? res : []
|
|
||||||
loaded.value = true
|
|
||||||
} catch {
|
|
||||||
options.value = []
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('click', clickOutside)
|
document.addEventListener('click', clickOutside)
|
||||||
|
loadOptions()
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user