File tree 4 files changed +26
-2
lines changed
4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,16 @@ defineProps<{
82
82
Custom icons with `prefix: ''` from local fs:
83
83
<Icon
84
84
name =" nuxt-v3"
85
- size =" 64"
85
+ size =" 32"
86
+ :mode
87
+ :customize
88
+ />
89
+ </p >
90
+ <p >
91
+ Custom icons with `prefix: 'custom-parts'` from local fs:
92
+ <Icon
93
+ name =" custom-parts-nuxt-v3"
94
+ size =" 32"
86
95
:mode
87
96
:customize
88
97
/>
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ export default defineNuxtConfig({
41
41
prefix : 'custom1' ,
42
42
dir : './icons/custom1' ,
43
43
} ,
44
+ {
45
+ prefix : 'custom-parts' ,
46
+ dir : './icons/custom-parts' ,
47
+ } ,
44
48
{
45
49
prefix : '' ,
46
50
dir : './icons/no-prefix' ,
Original file line number Diff line number Diff line change @@ -20,14 +20,22 @@ export class NuxtIconModuleContext {
20
20
) { }
21
21
22
22
getRuntimeCollections ( runtimeOptions : NuxtIconRuntimeOptions ) : string [ ] {
23
- return runtimeOptions . fallbackToApi
23
+ const resolved = runtimeOptions . fallbackToApi
24
24
? collectionNames
25
25
: typeof this . options . serverBundle === 'string'
26
26
? collectionNames
27
27
: this . options . serverBundle
28
28
? this . options . serverBundle . collections
29
29
?. map ( c => typeof c === 'string' ? c : c . prefix ) || [ ]
30
30
: [ ]
31
+
32
+ // Include custom collections prefixes
33
+ for ( const collection of this . options . customCollections || [ ] ) {
34
+ if ( collection . prefix && ! resolved . includes ( collection . prefix ) )
35
+ resolved . push ( collection . prefix )
36
+ }
37
+
38
+ return resolved
31
39
}
32
40
33
41
private _customCollections : IconifyJSON [ ] | Promise < IconifyJSON [ ] > | undefined
You can’t perform that action at this time.
0 commit comments