1
1
import { getIcon as _getIcon } from '@iconify/vue'
2
2
import type { PropType } from 'vue'
3
- import { computed , defineComponent , h , Suspense } from 'vue'
3
+ import { computed , defineComponent , h } from 'vue'
4
4
import type { NuxtIconRuntimeOptions , IconifyIconCustomizeCallback } from '../../types'
5
5
import { NuxtIconCss } from './css'
6
6
import { NuxtIconSvg } from './svg'
@@ -9,7 +9,6 @@ import { useAppConfig, useNuxtApp } from '#imports'
9
9
10
10
export default defineComponent ( {
11
11
name : 'NuxtIcon' ,
12
- inheritAttrs : false ,
13
12
props : {
14
13
name : {
15
14
type : String ,
@@ -29,13 +28,8 @@ export default defineComponent({
29
28
type : Function as PropType < IconifyIconCustomizeCallback > ,
30
29
required : false ,
31
30
} ,
32
- suspensible : {
33
- type : Boolean ,
34
- required : false ,
35
- default : true ,
36
- } ,
37
31
} ,
38
- setup ( props , { slots, attrs } ) {
32
+ setup ( props , { slots } ) {
39
33
const nuxtApp = useNuxtApp ( )
40
34
const runtimeOptions = useAppConfig ( ) . icon as NuxtIconRuntimeOptions
41
35
const name = useResolvedName ( ( ) => props . name )
@@ -54,29 +48,15 @@ export default defineComponent({
54
48
const customize = props . customize || runtimeOptions . customize
55
49
56
50
return ( ) => h (
57
- Suspense ,
58
- { suspensible : props . suspensible } ,
51
+ component . value ,
59
52
{
60
- default : ( ) => h (
61
- component . value ,
62
- {
63
- ...runtimeOptions . attrs ,
64
- ...attrs ,
65
- name : name . value ,
66
- class : [
67
- runtimeOptions . class ,
68
- attrs . class ,
69
- ] ,
70
- style : [
71
- style . value ,
72
- attrs . style ,
73
- ] ,
74
- customize,
75
- } ,
76
- slots ,
77
- ) ,
78
- fallback : ( ) => h ( 'span' , { class : 'iconify iconify-loading' } ) ,
53
+ ...runtimeOptions . attrs ,
54
+ name : name . value ,
55
+ class : runtimeOptions . class ,
56
+ style : style . value ,
57
+ customize,
79
58
} ,
59
+ slots ,
80
60
)
81
61
} ,
82
62
} )
0 commit comments