File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { App , reactive } from 'vue'
2
2
import type { UnwrapNestedRefs } from '@vue/reactivity'
3
+ import { objectKeys } from '@antfu/utils'
3
4
import * as nav from '../logic/nav'
4
5
5
6
declare module '@vue/runtime-core' {
@@ -11,9 +12,16 @@ declare module '@vue/runtime-core' {
11
12
export default function createSlidevContext ( ) {
12
13
return {
13
14
install ( app : App ) {
14
- app . config . globalProperties . $slidev = {
15
- nav : reactive ( { ...nav } ) ,
15
+ const navObj : typeof nav = { } as any
16
+ // need to copy over to get rid of the "Module" object type (will not unwrap)
17
+ for ( const key of objectKeys ( nav ) ) {
18
+ if ( typeof key === 'string' )
19
+ // @ts -expect-error
20
+ navObj [ key ] = nav [ key ]
16
21
}
22
+ app . config . globalProperties . $slidev = reactive ( {
23
+ nav : navObj ,
24
+ } )
17
25
} ,
18
26
}
19
27
}
You can’t perform that action at this time.
0 commit comments