1
1
import { resolveConfig } from 'vue-global-config'
2
- import type { App , Component } from 'vue-demi'
3
- import component from './component '
4
- import type { Mode } from './component '
2
+ import type { App } from 'vue-demi'
3
+ import Component from './Component '
4
+ import type { Mode } from './Component '
5
5
6
6
const globalProps : Record < keyof any , any > = { }
7
7
const globalAttrs : Record < keyof any , any > = { }
8
8
9
- type SFCWithInstall = Component & {
9
+ type SFCWithInstall = typeof Component & {
10
10
install : ( app : App , options ?: Record < keyof any , any > ) => void
11
11
}
12
12
13
- function withInstall ( sfc : Component ) : SFCWithInstall {
13
+ function withInstall ( sfc : typeof Component ) : SFCWithInstall {
14
14
( sfc as SFCWithInstall ) . install = ( app : App , options = { } ) : void => {
15
- const { props, attrs } = resolveConfig ( options , component . props )
15
+ const { props, attrs } = resolveConfig ( options , Component . props )
16
16
Object . assign ( globalProps , props )
17
17
Object . assign ( globalAttrs , attrs )
18
18
app . component ( sfc . name as string , sfc as Object )
@@ -22,4 +22,4 @@ function withInstall(sfc: Component): SFCWithInstall {
22
22
}
23
23
24
24
export { globalProps , globalAttrs , Mode }
25
- export default withInstall ( component )
25
+ export default withInstall ( Component )
0 commit comments