fix: enable nav commands only once
This commit is contained in:
parent
524f7005aa
commit
1054e556e8
4 changed files with 26 additions and 20 deletions
|
@ -8,18 +8,17 @@ const props = defineProps<{
|
|||
|
||||
const router = useRouter()
|
||||
|
||||
if (props.command) {
|
||||
useCommand({
|
||||
scope: 'Settings',
|
||||
useCommand({
|
||||
scope: 'Settings',
|
||||
|
||||
name: () => props.text ?? (typeof props.to === 'string' ? props.to as string : props.to.name),
|
||||
icon: () => props.icon || '',
|
||||
name: () => props.text ?? (typeof props.to === 'string' ? props.to as string : props.to.name),
|
||||
icon: () => props.icon || '',
|
||||
visible: () => props.command,
|
||||
|
||||
onActivate() {
|
||||
router.push(props.to)
|
||||
},
|
||||
})
|
||||
}
|
||||
onActivate() {
|
||||
router.push(props.to)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue