mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 11:47:55 +01:00
chore(CommandPalette): allow to disable autoselect (#84)
This commit is contained in:
committed by
GitHub
parent
4ce991652b
commit
2560088b2b
@@ -94,6 +94,10 @@ const props = defineProps({
|
|||||||
options: {
|
options: {
|
||||||
type: Object as PropType<Partial<UseFuseOptions<Command>>>,
|
type: Object as PropType<Partial<UseFuseOptions<Command>>>,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
|
},
|
||||||
|
autoselect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -103,7 +107,9 @@ const query = ref('')
|
|||||||
const comboboxInput = ref<ComponentPublicInstance<HTMLInputElement>>()
|
const comboboxInput = ref<ComponentPublicInstance<HTMLInputElement>>()
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
activateFirstOption()
|
if (props.autoselect) {
|
||||||
|
activateFirstOption()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const options: ComputedRef<Partial<UseFuseOptions<Command>>> = computed(() => defu({}, props.options, {
|
const options: ComputedRef<Partial<UseFuseOptions<Command>>> = computed(() => defu({}, props.options, {
|
||||||
|
|||||||
Reference in New Issue
Block a user