From c3d8db545f2e7706baec841abd309b33c31962ff Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Mon, 18 May 2020 18:48:23 +0800 Subject: [PATCH] fix(button): style fixes & code cleaning --- src/Button/src/Button.vue | 59 ++++++++-------------------- src/Button/src/styles/Button.cssr.js | 1 + 2 files changed, 17 insertions(+), 43 deletions(-) diff --git a/src/Button/src/Button.vue b/src/Button/src/Button.vue index c44e8c1ce..37d0444d6 100644 --- a/src/Button/src/Button.vue +++ b/src/Button/src/Button.vue @@ -29,9 +29,19 @@ @keyup.enter="handleKeyUpEnter" @keydown.enter="handleKeyDownEnter" > +
+ +
@@ -65,7 +75,7 @@
- - - - - - -
-
@@ -164,7 +138,7 @@ function mountColorStyle (color, colorHash) { function unmountColorStyle (colorHash) { colorStyle.unmount({ target: 'n-button-' + colorHash, - delay: 1000 + delay: 3000 }) } @@ -237,7 +211,6 @@ export default { return [ 'default', 'primary', - 'link', 'info', 'success', 'warning', @@ -252,8 +225,8 @@ export default { }, iconPlacement: { default: 'left', - validator (iconPlacement) { - return ['left', 'right'].includes(iconPlacement) + validator (value) { + return ['left', 'right'].includes(value) } } }, @@ -348,7 +321,7 @@ export default { this.rippleTimer = null this.rippling = false this.$nextTick().then(() => { - this.$el.getBoundingClientRect() + void this.$el.offsetHeight this.rippling = true this.rippleTimer = window.setTimeout(() => { this.rippling = false diff --git a/src/Button/src/styles/Button.cssr.js b/src/Button/src/styles/Button.cssr.js index 14fee1356..c893c3a3c 100644 --- a/src/Button/src/styles/Button.cssr.js +++ b/src/Button/src/styles/Button.cssr.js @@ -62,6 +62,7 @@ export function createColorStyle () { cM(`${digest}-colored`, createBasicColorProps( pallete.textColor, pallete.color, pallete.borderColor || pallete.color ), [ + createIconColorStyle(pallete.textColor), cNotM('disabled', [ cM( 'enter-pressed',