update the master branch to the latest
This commit is contained in:
parent
67d534df27
commit
23a0ba9831
611 changed files with 122648 additions and 0 deletions
51
src/components/icon/icon.vue
Normal file
51
src/components/icon/icon.vue
Normal file
|
@ -0,0 +1,51 @@
|
|||
<template>
|
||||
<i :class="classes" :style="styles" @click="handleClick"></i>
|
||||
</template>
|
||||
<script>
|
||||
const prefixCls = 'ivu-icon';
|
||||
|
||||
export default {
|
||||
name: 'Icon',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
size: [Number, String],
|
||||
color: String,
|
||||
custom: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
return [
|
||||
`${prefixCls}`,
|
||||
{
|
||||
[`${prefixCls}-${this.type}`]: this.type !== '',
|
||||
[`${this.custom}`]: this.custom !== '',
|
||||
}
|
||||
];
|
||||
},
|
||||
styles () {
|
||||
let style = {};
|
||||
|
||||
if (this.size) {
|
||||
style['font-size'] = `${this.size}px`;
|
||||
}
|
||||
|
||||
if (this.color) {
|
||||
style.color = this.color;
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick (event) {
|
||||
this.$emit('click', event);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
2
src/components/icon/index.js
Normal file
2
src/components/icon/index.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import Icon from './icon.vue';
|
||||
export default Icon;
|
Loading…
Add table
Add a link
Reference in a new issue