Merge branch 'master' of gitlab.qima-inc.com:fe/oxygen

This commit is contained in:
cookfront
2017-02-17 16:05:49 +08:00
7 changed files with 47 additions and 42 deletions

View File

@@ -32,15 +32,13 @@
* @example
* <z-button size="large" type="primary">按钮</z-button>
*/
const allowedSize = ['mini', 'small', 'normal', 'large'];
const allowedType = ['default', 'danger', 'primary'];
export default {
name: 'z-button',
methods: {
handleClick(e) {
this.$emit('click', e);
}
},
props: {
disabled: Boolean,
loading: Boolean,
@@ -49,23 +47,14 @@ export default {
type: String,
default: 'default',
validator(value) {
return [
'default',
'danger',
'primary'
].indexOf(value) > -1;
return allowedSize.indexOf(value) > -1;
}
},
size: {
type: String,
default: 'normal',
validator(value) {
return [
'mini',
'small',
'normal',
'large'
].indexOf(value) > -1;
return allowedType.indexOf(value) > -1;
}
}
}