mirror of
https://github.com/coreui/coreui-icons.git
synced 2025-08-21 16:01:25 +02:00
refactor: delete vue.js module
This commit is contained in:
@@ -1,77 +0,0 @@
|
|||||||
<template>
|
|
||||||
<svg
|
|
||||||
v-if="name || content"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
:viewBox="viewBox"
|
|
||||||
:class="computedClasses"
|
|
||||||
v-html="icon.svgContent"
|
|
||||||
></svg>
|
|
||||||
<component
|
|
||||||
v-else
|
|
||||||
:is="fontIconTag"
|
|
||||||
:class="computedClasses"
|
|
||||||
></component>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'CIcon',
|
|
||||||
//This object contains icons added before component registration
|
|
||||||
icons: {},
|
|
||||||
props: {
|
|
||||||
name: String,
|
|
||||||
content: [String, Array],
|
|
||||||
// fill: String,
|
|
||||||
// background: String,
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
validator: size => ['sm', 'lg', 'xl', 'custom-size'].includes(size)
|
|
||||||
},
|
|
||||||
customClasses: [String, Array, Object],
|
|
||||||
fontIconTag: {
|
|
||||||
type: String,
|
|
||||||
default: 'i'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
iconName () {
|
|
||||||
const iconNameIsKebabCase = this.name && this.name.includes('-')
|
|
||||||
return iconNameIsKebabCase ? this.toCamelCase(this.name) : this.name
|
|
||||||
},
|
|
||||||
code () {
|
|
||||||
return this.content || this.$options.icons[this.iconName]
|
|
||||||
},
|
|
||||||
icon () {
|
|
||||||
if (Array.isArray(this.code)) {
|
|
||||||
const coordinates = this.code.length > 1 ? this.code[0] : '64 64'
|
|
||||||
const svgContent = this.code.length > 1 ? this.code[1] : this.code[0]
|
|
||||||
return { coordinates, svgContent }
|
|
||||||
}
|
|
||||||
return { coordinates: '64 64', svgContent: this.code }
|
|
||||||
},
|
|
||||||
viewBox () {
|
|
||||||
return this.$attrs.viewBox || `0 0 ${ this.icon.coordinates }`
|
|
||||||
},
|
|
||||||
// style () {
|
|
||||||
// return {
|
|
||||||
// fill: this.fill || 'currentColor',
|
|
||||||
// background: this.background
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
computedSize () {
|
|
||||||
return this.$attrs.width || this.$attrs.height ? 'custom-size' : this.size
|
|
||||||
},
|
|
||||||
computedClasses () {
|
|
||||||
return this.customClasses ||
|
|
||||||
['c-icon', { [`c-icon-${this.computedSize}`]: this.computedSize }]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toCamelCase (str) {
|
|
||||||
return str.replace(/([-_][a-z0-9])/ig, ($1) => {
|
|
||||||
return $1.toUpperCase().replace('-', '')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
["@vue/app", {
|
|
||||||
"modules": false
|
|
||||||
}]
|
|
||||||
]
|
|
||||||
}
|
|
1789
vue/dist/coreui-icons-vue.common.js
vendored
1789
vue/dist/coreui-icons-vue.common.js
vendored
File diff suppressed because it is too large
Load Diff
1
vue/dist/coreui-icons-vue.common.js.map
vendored
1
vue/dist/coreui-icons-vue.common.js.map
vendored
File diff suppressed because one or more lines are too long
1799
vue/dist/coreui-icons-vue.umd.js
vendored
1799
vue/dist/coreui-icons-vue.umd.js
vendored
File diff suppressed because it is too large
Load Diff
1
vue/dist/coreui-icons-vue.umd.js.map
vendored
1
vue/dist/coreui-icons-vue.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
vue/dist/coreui-icons-vue.umd.min.js
vendored
2
vue/dist/coreui-icons-vue.umd.min.js
vendored
File diff suppressed because one or more lines are too long
1
vue/dist/coreui-icons-vue.umd.min.js.map
vendored
1
vue/dist/coreui-icons-vue.umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
10
vue/dist/demo.html
vendored
10
vue/dist/demo.html
vendored
@@ -1,10 +0,0 @@
|
|||||||
<meta charset="utf-8">
|
|
||||||
<title>coreui-icons-vue demo</title>
|
|
||||||
<script src="./coreui-icons-vue.umd.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./coreui-icons-vue.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log(coreui-icons-vue)
|
|
||||||
</script>
|
|
10
vue/index.js
10
vue/index.js
@@ -1,10 +0,0 @@
|
|||||||
import CIcon from './CIcon'
|
|
||||||
export { CIcon }
|
|
||||||
|
|
||||||
const CIconPlugin = {
|
|
||||||
install (Vue, customIconSet) {
|
|
||||||
CIcon.icons = customIconSet
|
|
||||||
Vue.component('CIcon', CIcon)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export { CIconPlugin }
|
|
12243
vue/package-lock.json
generated
12243
vue/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "coreui-icons-vue",
|
|
||||||
"sideEffects": false,
|
|
||||||
"version": "1.0.0-alpha.1",
|
|
||||||
"main": "dist/coreui-icons-vue.common.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "vue-cli-service build --target lib --name coreui-icons-vue ./index.js",
|
|
||||||
"lint": "vue-cli-service lint"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@vue/cli-plugin-babel": "^3.8.0",
|
|
||||||
"@vue/cli-plugin-eslint": "^3.8.0",
|
|
||||||
"@vue/cli-service": "^3.8.0",
|
|
||||||
"babel-eslint": "^10.0.1",
|
|
||||||
"babel-preset-vue-app": "^2.0.0",
|
|
||||||
"eslint": "^5.16.0",
|
|
||||||
"eslint-plugin-vue": "^5.0.0",
|
|
||||||
"vue-template-compiler": "^2.6.10"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"plugin:vue/essential",
|
|
||||||
"eslint:recommended"
|
|
||||||
],
|
|
||||||
"rules": {},
|
|
||||||
"parserOptions": {
|
|
||||||
"parser": "babel-eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"postcss": {
|
|
||||||
"plugins": {
|
|
||||||
"autoprefixer": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"not ie <= 8"
|
|
||||||
]
|
|
||||||
}
|
|
Reference in New Issue
Block a user