mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 04:29:37 +01:00
chore(CommandPalette): remove click and to handling
This commit is contained in:
@@ -84,8 +84,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'close'])
|
||||
|
||||
const query = ref('')
|
||||
@@ -131,12 +129,6 @@ function onSelect (option: Command) {
|
||||
return
|
||||
}
|
||||
|
||||
if (option.click) {
|
||||
option.click()
|
||||
} else if (option.to) {
|
||||
router.push(option.to)
|
||||
}
|
||||
|
||||
emit('update:modelValue', option)
|
||||
|
||||
// waiting for modal to be closed
|
||||
|
||||
3
src/runtime/types/command-palette.d.ts
vendored
3
src/runtime/types/command-palette.d.ts
vendored
@@ -1,5 +1,4 @@
|
||||
import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
|
||||
import type { RouteLocationRaw } from 'vue-router'
|
||||
|
||||
export interface Command {
|
||||
prefix?: string
|
||||
@@ -11,8 +10,6 @@ export interface Command {
|
||||
chip?: string
|
||||
disabled?: boolean
|
||||
prevent?: boolean
|
||||
click?: Function
|
||||
to?: RouteLocationRaw
|
||||
shortcuts?: string[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user