From 7bf80c588f644a284ab1638db569167de4fee20d Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Thu, 3 Aug 2023 18:38:06 +0200 Subject: [PATCH] fix: (issue #165) add type RouteLocationRaw for prop "to" --- packages/components/button/src/button.ts | 3 ++- packages/components/sidebar/src/sidebar-item.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/components/button/src/button.ts b/packages/components/button/src/button.ts index 141e0e01..e041cc44 100644 --- a/packages/components/button/src/button.ts +++ b/packages/components/button/src/button.ts @@ -1,4 +1,5 @@ import { buildProps } from '@puik/utils' +import type { RouteLocationRaw } from 'vue-router' import type { ExtractPropTypes, PropType } from 'vue' import type Button from './button.vue' @@ -51,7 +52,7 @@ export const buttonProps = buildProps({ default: '', }, to: { - type: String, + type: [Object, String] as PropType, required: false, default: undefined, }, diff --git a/packages/components/sidebar/src/sidebar-item.ts b/packages/components/sidebar/src/sidebar-item.ts index efd4a33b..b4b6a3df 100644 --- a/packages/components/sidebar/src/sidebar-item.ts +++ b/packages/components/sidebar/src/sidebar-item.ts @@ -1,5 +1,6 @@ import { buildProps } from '@puik/utils' -import type { ExtractPropTypes } from 'vue' +import type { RouteLocationRaw } from 'vue-router' +import type { ExtractPropTypes, PropType } from 'vue' import type SidebarItem from './sidebar-item.vue' export const sidebarItemProps = buildProps({ @@ -13,7 +14,7 @@ export const sidebarItemProps = buildProps({ default: undefined, }, to: { - type: String, + type: [Object, String] as PropType, required: false, default: undefined, },