File tree 4 files changed +7
-6
lines changed
4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,8 @@ export function registerClientBundle(
44
44
const collectionsRaw = `JSON.parse(${ JSON . stringify ( valuesCompat ) } )`
45
45
46
46
return [
47
- 'import { addIcon } from "@iconify/vue"' ,
48
47
'let _initialized = false' ,
49
- 'export function init() {' ,
48
+ 'export function init(addIcon ) {' ,
50
49
' if (_initialized)' ,
51
50
' return' ,
52
51
` const collections = ${ collectionsRaw } ` ,
Original file line number Diff line number Diff line change 1
1
import { computed } from 'vue'
2
- import { getIcon as _getIcon , loadIcon as _loadIcon } from '@iconify/vue'
2
+ import { getIcon as _getIcon , addIcon as _addIcon , loadIcon as _loadIcon } from '@iconify/vue'
3
3
import { consola } from 'consola'
4
4
import type { IconifyIcon } from '@iconify/types'
5
5
import type { NuxtIconRuntimeOptions } from '../../types'
@@ -11,7 +11,7 @@ export { initClientBundle }
11
11
export async function loadIcon ( name : string , timeout : number ) : Promise < Required < IconifyIcon > | null > {
12
12
if ( ! name )
13
13
return null
14
- initClientBundle ( )
14
+ initClientBundle ( _addIcon )
15
15
const _icon = _getIcon ( name )
16
16
if ( _icon )
17
17
return _icon
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const NuxtIconSvg = /* @__PURE__ */ defineComponent({
41
41
addIcon ( name . value , payload )
42
42
}
43
43
else {
44
- initClientBundle ( )
44
+ initClientBundle ( addIcon )
45
45
}
46
46
}
47
47
}
Original file line number Diff line number Diff line change @@ -5,5 +5,7 @@ declare module '#nuxt-icon-server-bundle' {
5
5
}
6
6
7
7
declare module '#build/nuxt-icon-client-bundle' {
8
- export function init ( ) : void
8
+ import type { IconifyIcon } from '@iconify/types'
9
+
10
+ export function init ( addIcon : ( ( name : string , data : IconifyIcon ) => void ) ) : void
9
11
}
You can’t perform that action at this time.
0 commit comments