From f8f263986f9633444eaa1ffdb03278f8826b999a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=97=A5=E5=A4=A9?= <61126721+TrueNine@users.noreply.github.com> Date: Fri, 17 May 2024 03:39:48 +0800 Subject: [PATCH] feat: add vuetify3Resolver labs support --- src/core/resolvers/vuetify.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/resolvers/vuetify.ts b/src/core/resolvers/vuetify.ts index 0aea9f19..40aaadd2 100644 --- a/src/core/resolvers/vuetify.ts +++ b/src/core/resolvers/vuetify.ts @@ -15,17 +15,30 @@ export function VuetifyResolver(): ComponentResolver { } } +const _vLabsComponentNames = [ + 'VCalendar', + 'VNumberInput', + 'VPicker', + 'VDateInput', + 'VPullToRefresh', + 'VSnackbarQueue', + 'VStepperVertical', + 'VTimePicker', + 'VTreeview' +] + /** * Resolver for Vuetify 3 Beta * * @link https://github.com/vuetifyjs/vuetify + * @link https://vuetifyjs.com/en/labs/introduction/ */ -export function Vuetify3Resolver(): ComponentResolver { +export function Vuetify3Resolver(useLabsComponent?: boolean = false): ComponentResolver { return { type: 'component', resolve: (name: string) => { if (name.match(/^V[A-Z]/)) - return { name, from: 'vuetify/components' } + return { name, from: useLabsComponent && _vLabsComponentNames.includes(name) ? 'vuetify/labs/components' : 'vuetify/components' } }, } }