diff --git a/packages/utils/vue/install.ts b/packages/utils/vue/install.ts index fe1c512589..08b7fbb793 100644 --- a/packages/utils/vue/install.ts +++ b/packages/utils/vue/install.ts @@ -1,6 +1,6 @@ import { NOOP } from '@vue/shared' -import type { App } from 'vue' +import type { App, Directive } from 'vue' import type { SFCInstallWithContext, SFCWithInstall } from './typescript' export const withInstall = >( @@ -30,7 +30,10 @@ export const withInstallFunction = (fn: T, name: string) => { return fn as SFCInstallWithContext } -export const withInstallDirective = (directive: T, name: string) => { +export const withInstallDirective = ( + directive: T, + name: string +) => { ;(directive as SFCWithInstall).install = (app: App): void => { app.directive(name, directive) }