Tag add more color and rename old colors

This commit is contained in:
梁灏 2018-06-22 17:05:36 +08:00
parent a980832f84
commit 855d49406c
9 changed files with 1598 additions and 39 deletions

View file

@ -168,7 +168,7 @@
},
contentPaddingStyle () {
const styles = {};
if (!!this.padding) styles['padding'] = this.padding;
if (this.padding !== '') styles['padding'] = this.padding;
return styles;
}
},

View file

@ -16,7 +16,9 @@
import Icon from '../icon';
import { oneOf } from '../../utils/assist';
const prefixCls = 'ivu-tag';
const initColorList = ['blue', 'green', 'red', 'yellow', 'default'];
const initColorList = ['default', 'primary', 'success', 'warning', 'error', 'blue', 'green', 'red', 'yellow', 'pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
const colorList = ['pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
export default {
name: 'Tag',
components: { Icon },
@ -74,7 +76,7 @@
return [
`${prefixCls}-text`,
this.type === 'border' ? (oneOf(this.color, initColorList) ? `${prefixCls}-color-${this.color}` : '') : '',
(this.type !== 'dot' && this.type !== 'border' && this.color !== 'default') ? (this.isChecked ? `${prefixCls}-color-white` : '') : ''
(this.type !== 'dot' && this.type !== 'border' && this.color !== 'default') ? (this.isChecked && colorList.indexOf(this.color) < 0 ? `${prefixCls}-color-white` : '') : ''
];
},
dotClasses () {