mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +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 emit = defineEmits(['update:modelValue', 'close'])
|
||||||
|
|
||||||
const query = ref('')
|
const query = ref('')
|
||||||
@@ -131,12 +129,6 @@ function onSelect (option: Command) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option.click) {
|
|
||||||
option.click()
|
|
||||||
} else if (option.to) {
|
|
||||||
router.push(option.to)
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('update:modelValue', option)
|
emit('update:modelValue', option)
|
||||||
|
|
||||||
// waiting for modal to be closed
|
// 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 { UseFuseOptions } from '@vueuse/integrations/useFuse'
|
||||||
import type { RouteLocationRaw } from 'vue-router'
|
|
||||||
|
|
||||||
export interface Command {
|
export interface Command {
|
||||||
prefix?: string
|
prefix?: string
|
||||||
@@ -11,8 +10,6 @@ export interface Command {
|
|||||||
chip?: string
|
chip?: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
prevent?: boolean
|
prevent?: boolean
|
||||||
click?: Function
|
|
||||||
to?: RouteLocationRaw
|
|
||||||
shortcuts?: string[]
|
shortcuts?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user