From 72a60dc3e11651e0d29cb5bba4da329468be1934 Mon Sep 17 00:00:00 2001 From: niunai Date: Wed, 15 Feb 2017 17:47:36 +0800 Subject: [PATCH] add border --- .eslintignore | 1 + packages/button/src/button.pcss | 3 +++ packages/button/src/button.vue | 23 ++++++----------------- packages/zenui/src/common/var.pcss | 11 +++++++---- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.eslintignore b/.eslintignore index 8d1a11e8d..72bf17083 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ lib/ dist/ node_modules/ +build/ diff --git a/packages/button/src/button.pcss b/packages/button/src/button.pcss index 44471eb30..2549e72ac 100644 --- a/packages/button/src/button.pcss +++ b/packages/button/src/button.pcss @@ -28,16 +28,19 @@ @modifier default { color: $button-default-color; background-color: $button-default-background-color; + border: 1px solid $button-default-border-color; } @modifier primary { color: $button-primary-color; background-color: $button-primary-background-color; + border: 1px solid $button-primary-border-color; } @modifier danger { color: $button-danger-color; background-color: $button-danger-background-color; + border: 1px solid $button-danger-border-color; } @modifier large { diff --git a/packages/button/src/button.vue b/packages/button/src/button.vue index 3ad85c5e7..06fb5ec8b 100644 --- a/packages/button/src/button.vue +++ b/packages/button/src/button.vue @@ -32,15 +32,13 @@ * @example * 按钮 */ + +const allowedSize = ['mini', 'small', 'normal', 'large']; +const allowedType = ['default', 'danger', 'primary']; + export default { name: 'o2-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; } } } diff --git a/packages/zenui/src/common/var.pcss b/packages/zenui/src/common/var.pcss index e36d8d778..00c165b40 100644 --- a/packages/zenui/src/common/var.pcss +++ b/packages/zenui/src/common/var.pcss @@ -17,12 +17,15 @@ $c-blue: #38f; $c-background: #f8f8f8; /* 按钮颜色 */ -$button-default-color: $c-white; -$button-default-background-color: $c-green-wx; -$button-primary-color: $c-black; -$button-primary-background-color: $c-white; +$button-primary-color: $c-white; +$button-primary-background-color: $c-green-wx; +$button-primary-border-color: #0a0; +$button-default-color: $c-black; +$button-default-background-color: $c-white; +$button-default-border-color: #bbb; $button-danger-color: $c-white; $button-danger-background-color: #f44; +$button-danger-border-color: #e33; :root{