Skip to content

Commit b30440e

Browse files
committed
feat: add warnings if user calls wrong icon name
1 parent b9747f1 commit b30440e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/CIconRaw.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ export default {
5252
if (this.content) {
5353
return this.content
5454
} else if (this.$root.$options.icons) {
55-
return this.$root.$options.icons[this.iconName]
55+
const icon = this.$root.$options.icons[this.iconName]
56+
if (!icon && process && process.env && process.env.NODE_ENV === 'development') {
57+
console.error('CIcon: "' + this.iconName + '" is not registered in $root.icons object. For CIcon docs visit https://coreui.io/vue/docs/components/icon.html')
58+
}
59+
return icon
5660
}
5761
},
5862
iconCode () {

0 commit comments

Comments
 (0)