fix: enable nav commands only once

This commit is contained in:
三咲智子 2022-12-30 03:31:29 +08:00
parent 524f7005aa
commit 1054e556e8
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
4 changed files with 26 additions and 20 deletions

View file

@ -1,9 +1,12 @@
<script setup lang="ts">
import { warn } from 'vue'
const props = withDefaults(defineProps<{
text?: string
icon: string
to: string | Record<string, string>
userOnly?: boolean
command?: boolean
}>(), {
userOnly: false,
})
@ -20,6 +23,7 @@ useCommand({
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)