Skip to content

Commit b59e399

Browse files
committed
Add name property to VueSvgIcon component
1 parent f1f6505 commit b59e399

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vue-svgicon/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineComponent, h, App, PropType, isVue2 } from 'vue-demi'
33
import { svgIcon, Options, setOptions, getOptions, Icon } from '@yzfe/svgicon'
44

55
const VueSvgIcon = defineComponent({
6+
name: 'VueSvgIcon',
67
props: {
78
/** icon data */
89
data: {
@@ -82,7 +83,7 @@ const VueSvgIconPlugin = {
8283

8384
function createIconComponent(data: Icon) {
8485
const name = (data.name.split('/').pop() || '').replace(/^[\\d_]+/, '')
85-
const componentName = name || 'SvgIcon'
86+
const componentName = `SvgIcon${name}`
8687

8788
return defineComponent({
8889
name: componentName,

0 commit comments

Comments
 (0)