diff --git a/src/runtime/components/navigation/CommandPalette.vue b/src/runtime/components/navigation/CommandPalette.vue
index fb4eb264..a8210084 100644
--- a/src/runtime/components/navigation/CommandPalette.vue
+++ b/src/runtime/components/navigation/CommandPalette.vue
@@ -20,7 +20,7 @@
-
+
@@ -126,7 +126,7 @@ function activateFirstOption () {
}, 0)
}
-function onSelect (option) {
+function onSelect (option: Command) {
if (option.disabled) {
return
}
@@ -140,9 +140,11 @@ function onSelect (option) {
emit('update:modelValue', option)
// waiting for modal to be closed
- setTimeout(() => {
- query.value = ''
- }, 300)
+ if (!option.prevent) {
+ setTimeout(() => {
+ query.value = ''
+ }, 300)
+ }
}
function onClear () {
diff --git a/src/runtime/types/command-palette.d.ts b/src/runtime/types/command-palette.d.ts
index 00fd87aa..a3474d83 100644
--- a/src/runtime/types/command-palette.d.ts
+++ b/src/runtime/types/command-palette.d.ts
@@ -1,4 +1,5 @@
import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
+import type { RouteLocationRaw } from 'vue-router'
export interface Command {
prefix?: string
@@ -9,6 +10,9 @@ export interface Command {
avatar?: string
chip?: string
disabled?: boolean
+ prevent?: boolean
+ click?: Function
+ to?: RouteLocationRaw
shortcuts?: string[]
}