From ca3d3ce053c5ed809b1d88b6d380ca12f5986db4 Mon Sep 17 00:00:00 2001 From: m0ksem Date: Tue, 31 May 2022 02:08:59 +0300 Subject: [PATCH 1/2] Fix redeclaration of @vue/runtime-core. --- packages/ui/src/components/va-dropdown/plugin/index.ts | 2 +- packages/ui/src/components/va-modal/plugin/index.ts | 2 +- packages/ui/src/components/va-toast/plugin/index.ts | 7 ++++--- packages/ui/src/services/color-config/plugin/index.ts | 2 +- packages/ui/src/services/global-config/plugin/index.ts | 2 +- packages/ui/src/vuestic-plugin/utils/global-properties.ts | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/components/va-dropdown/plugin/index.ts b/packages/ui/src/components/va-dropdown/plugin/index.ts index ecc9c657dc..fee1c03e2e 100644 --- a/packages/ui/src/components/va-dropdown/plugin/index.ts +++ b/packages/ui/src/components/va-dropdown/plugin/index.ts @@ -21,7 +21,7 @@ export const VaDropdownPlugin = defineVuesticPlugin(() => ({ }, })) -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaDropdown: typeof vaDropdownPlugin diff --git a/packages/ui/src/components/va-modal/plugin/index.ts b/packages/ui/src/components/va-modal/plugin/index.ts index d1235a7aa4..ed1cbaf31e 100644 --- a/packages/ui/src/components/va-modal/plugin/index.ts +++ b/packages/ui/src/components/va-modal/plugin/index.ts @@ -15,7 +15,7 @@ export const VaModalPlugin = defineVuesticPlugin(() => ({ }, })) -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaModal: ReturnType } diff --git a/packages/ui/src/components/va-toast/plugin/index.ts b/packages/ui/src/components/va-toast/plugin/index.ts index 09cdc817c4..05685e3b72 100644 --- a/packages/ui/src/components/va-toast/plugin/index.ts +++ b/packages/ui/src/components/va-toast/plugin/index.ts @@ -1,10 +1,11 @@ -import { App } from 'vue' +import { App, ref } from 'vue' import { defineVuesticPlugin, defineGlobalProperty } from '../../../vuestic-plugin/utils' import { createToastInstance, closeById, closeAllNotifications, NotificationOptions } from '../toast' const createVaToastPlugin = (app: App) => ({ /** Returns toast instance id */ init (options: string | NotificationOptions) { + console.log(ref) return createToastInstance(options, app?._context) }, @@ -19,11 +20,11 @@ const createVaToastPlugin = (app: App) => ({ export const VaToastPlugin = defineVuesticPlugin(() => ({ install (app) { - defineGlobalProperty(app, '$vaToast', createVaToastPlugin(app)) + defineGlobalProperty(app, '$vaToast' as any, createVaToastPlugin(app)) }, })) -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaToast: ReturnType } diff --git a/packages/ui/src/services/color-config/plugin/index.ts b/packages/ui/src/services/color-config/plugin/index.ts index 3d16bd56d7..bb3df3ab23 100644 --- a/packages/ui/src/services/color-config/plugin/index.ts +++ b/packages/ui/src/services/color-config/plugin/index.ts @@ -9,7 +9,7 @@ export const ColorConfigPlugin = defineVuesticPlugin(() => ({ }, })) -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaColorConfig: ReturnType } diff --git a/packages/ui/src/services/global-config/plugin/index.ts b/packages/ui/src/services/global-config/plugin/index.ts index 787dcf15e9..5747ad8c29 100644 --- a/packages/ui/src/services/global-config/plugin/index.ts +++ b/packages/ui/src/services/global-config/plugin/index.ts @@ -16,7 +16,7 @@ export const GlobalConfigPlugin = defineVuesticPlugin((config: GlobalConfig | un }, })) -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaConfig: ReturnType } diff --git a/packages/ui/src/vuestic-plugin/utils/global-properties.ts b/packages/ui/src/vuestic-plugin/utils/global-properties.ts index 6e3dcf9328..04c463631b 100644 --- a/packages/ui/src/vuestic-plugin/utils/global-properties.ts +++ b/packages/ui/src/vuestic-plugin/utils/global-properties.ts @@ -7,7 +7,7 @@ export const extractGlobalProperties = (app: App) => app.config.globalProperties * Type safe set vue global property * Declare type before use this method. * ``` -declare module '@vue/runtime-core' { +declare module 'vue' { export interface ComponentCustomProperties { $vaThing: ThingType } From 33a6804a4fa923ff74d76efcc97c9e131dd60c7d Mon Sep 17 00:00:00 2001 From: m0ksem Date: Tue, 31 May 2022 15:33:45 +0300 Subject: [PATCH 2/2] Minor. Remove debug things. --- packages/ui/src/components/va-toast/plugin/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ui/src/components/va-toast/plugin/index.ts b/packages/ui/src/components/va-toast/plugin/index.ts index 05685e3b72..2d635367f3 100644 --- a/packages/ui/src/components/va-toast/plugin/index.ts +++ b/packages/ui/src/components/va-toast/plugin/index.ts @@ -5,7 +5,6 @@ import { createToastInstance, closeById, closeAllNotifications, NotificationOpti const createVaToastPlugin = (app: App) => ({ /** Returns toast instance id */ init (options: string | NotificationOptions) { - console.log(ref) return createToastInstance(options, app?._context) }, @@ -20,7 +19,7 @@ const createVaToastPlugin = (app: App) => ({ export const VaToastPlugin = defineVuesticPlugin(() => ({ install (app) { - defineGlobalProperty(app, '$vaToast' as any, createVaToastPlugin(app)) + defineGlobalProperty(app, '$vaToast', createVaToastPlugin(app)) }, }))