Skip to content

Commit 06121a6

Browse files
committed
types: should import type 'Plugin' from 'vue-demi' instead of 'vue'
1 parent a458999 commit 06121a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/install.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import type { Plugin } from 'vue'
21
import { useGlobalConfig } from 'vue-global-config'
2+
import type { Plugin, install } from 'vue-demi'
33
import Component from './Component'
44
import type { Mode } from './Component'
55

6-
type SFCWithInstall<T> = T & Plugin
6+
type SFCWithInstall<T> = T & Plugin & { install: typeof install }
77

88
const withInstall = <T, E extends Record<string, any>>(
99
main: T,
1010
extra?: E,
1111
) => {
1212
(main as SFCWithInstall<T>).install = (app): void => {
1313
for (const comp of [main, ...Object.values(extra ?? {})]) {
14-
app.component(comp.name, comp)
14+
app?.component(comp.name, comp)
1515
}
1616
}
1717

0 commit comments

Comments
 (0)