Button add 4 new type

Button add 4 new type
This commit is contained in:
梁灏 2016-11-21 09:48:16 +08:00
parent 9084eb1872
commit b88f42eb62
5 changed files with 34 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View file

@ -17,7 +17,7 @@
props: { props: {
type: { type: {
validator (value) { validator (value) {
return oneOf(value, ['primary', 'ghost', 'dashed', 'text']); return oneOf(value, ['primary', 'ghost', 'dashed', 'text', 'info', 'success', 'warning', 'error']);
} }
}, },
shape: { shape: {

View file

@ -46,6 +46,22 @@
.btn-text; .btn-text;
} }
&-success {
.btn-color(@success-color);
}
&-warning {
.btn-color(@warning-color);
}
&-error {
.btn-color(@error-color);
}
&-info {
.btn-color(@info-color);
}
//&-dashed { //&-dashed {
// .btn-dashed; // .btn-dashed;
//} //}

View file

@ -248,6 +248,18 @@
} }
} }
// Color
.btn-color(@color) {
.button-variant(@btn-primary-color; @color; @color);
&:hover,
//&:focus,
&:active,
&.active {
color: @btn-primary-color;
}
}
// Circle for Icon // Circle for Icon
.btn-circle(@btnClassName: ivu-btn) { .btn-circle(@btnClassName: ivu-btn) {
border-radius: @btn-circle-size; border-radius: @btn-circle-size;

View file

@ -1,6 +1,11 @@
<template> <template>
<h4>基本</h4> <h4>基本</h4>
<br><br> <br><br>
<i-button type="success">按钮</i-button>
<i-button type="warning">按钮</i-button>
<i-button type="error">按钮</i-button>
<i-button type="info">按钮</i-button>
<br><br>
<Button-group> <Button-group>
<i-button>取消</i-button> <i-button>取消</i-button>
<i-button type="primary">确定</i-button> <i-button type="primary">确定</i-button>