fix: allow sending entire route to sidebarLink

This commit is contained in:
Shariq Ansari 2024-01-01 18:54:48 +05:30
parent 98a1fcbf00
commit e0b3fbb5a0

View File

@ -45,7 +45,7 @@ const props = defineProps({
default: '', default: '',
}, },
to: { to: {
type: String, type: [Object, String],
default: '', default: '',
}, },
isCollapsed: { isCollapsed: {
@ -55,7 +55,11 @@ const props = defineProps({
}) })
function handleClick() { function handleClick() {
router.push({ name: props.to }) if (typeof props.to === 'object') {
router.push(props.to)
} else {
router.push({ name: props.to })
}
} }
let isActive = computed(() => { let isActive = computed(() => {