1
0
mirror of https://github.com/coreui/coreui-icons.git synced 2025-08-21 07:51:21 +02:00

feat: add vue CIcon component and CIcon plugin containing all icons

This commit is contained in:
woothu
2019-05-29 16:55:00 +02:00
parent ddc61dd25f
commit be197f2465
2 changed files with 34 additions and 0 deletions

22
vue/CIcon.vue Normal file
View File

@@ -0,0 +1,22 @@
<template>
<svg width="64" height="64" v-html="computedCode"></svg>
</template>
<script>
export default {
name: 'CIcon',
icons: {},
props: {
iconCode: String,
icon: String
},
mounted () {
console.log(this.$options.icons)
},
computed: {
computedCode () {
return this.iconCode || this.$options.icons[this.icon]
}
}
}
</script>

12
vue/index.js Normal file
View File

@@ -0,0 +1,12 @@
import Icons from '../js/iconsGenerated.js'
import CIcon from './CIcon'
export { CIcon }
const VueCIconPlugin = {
install (Vue) {
CIcon.icons = Icons
Vue.component('CIcon', CIcon)
}
}
export { VueCIconPlugin }