This commit is contained in:
cookfront
2017-03-30 17:40:15 +08:00
parent 09be7c9323
commit e241d92cd9
5 changed files with 132 additions and 30 deletions

View File

@@ -11,8 +11,8 @@
* <zan-button size="large" type="primary">按钮</zan-button>
*/
const allowedSize = ['mini', 'small', 'normal', 'large'];
const allowedType = ['default', 'danger', 'primary'];
const ALLOWED_SIZE = ['mini', 'small', 'normal', 'large'];
const ALLOWED_TYPE = ['default', 'danger', 'primary'];
export default {
name: 'zan-button',
@@ -31,14 +31,14 @@ export default {
type: String,
default: 'default',
validator(value) {
return allowedType.indexOf(value) > -1;
return ALLOWED_TYPE.indexOf(value) > -1;
}
},
size: {
type: String,
default: 'normal',
validator(value) {
return allowedSize.indexOf(value) > -1;
return ALLOWED_SIZE.indexOf(value) > -1;
}
}
},