chore(CommandPalette): allow to disable autoselect (#84)

This commit is contained in:
Sylvain Marroufin
2022-10-05 15:10:51 +02:00
committed by GitHub
parent 4ce991652b
commit 2560088b2b

View File

@@ -94,6 +94,10 @@ const props = defineProps({
options: {
type: Object as PropType<Partial<UseFuseOptions<Command>>>,
default: () => ({})
},
autoselect: {
type: Boolean,
default: true
}
})
@@ -103,7 +107,9 @@ const query = ref('')
const comboboxInput = ref<ComponentPublicInstance<HTMLInputElement>>()
onMounted(() => {
activateFirstOption()
if (props.autoselect) {
activateFirstOption()
}
})
const options: ComputedRef<Partial<UseFuseOptions<Command>>> = computed(() => defu({}, props.options, {