From d9f08b99ca4e3dcff8fffd459ce0af92d2364471 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 18 Jul 2022 16:04:47 +0200 Subject: [PATCH] chore(CommandPalette): remove click and to handling --- src/runtime/components/navigation/CommandPalette.vue | 8 -------- src/runtime/types/command-palette.d.ts | 3 --- 2 files changed, 11 deletions(-) diff --git a/src/runtime/components/navigation/CommandPalette.vue b/src/runtime/components/navigation/CommandPalette.vue index b28069f6..8758b074 100644 --- a/src/runtime/components/navigation/CommandPalette.vue +++ b/src/runtime/components/navigation/CommandPalette.vue @@ -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 diff --git a/src/runtime/types/command-palette.d.ts b/src/runtime/types/command-palette.d.ts index a3474d83..afbbd104 100644 --- a/src/runtime/types/command-palette.d.ts +++ b/src/runtime/types/command-palette.d.ts @@ -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[] }