From 963ae8914f5efb57860f4ca9798be7250b3f6b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E5=AE=B6=E6=80=BF?= Date: Mon, 5 Jul 2021 10:37:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(switch):=20=E4=BF=AE=E5=A4=8Dsize?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=97=A0=E6=95=88,=E4=BF=AE=E6=94=B9switch?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=96=87=E4=BB=B6=E9=87=87=E7=94=A8em?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/switch/src/main.vue | 2 +- src/style/abstracts/_variable.scss | 6 +++--- src/style/switch.scss | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/switch/src/main.vue b/packages/switch/src/main.vue index de12e04e..898e2cda 100644 --- a/packages/switch/src/main.vue +++ b/packages/switch/src/main.vue @@ -90,7 +90,7 @@ export default { !this.disabled && this.handleChange() }, handleChange () { - let val = this.checked ? this.inactiveValue : this.activeValue + const val = this.checked ? this.inactiveValue : this.activeValue if (this.beforeChange) { this.beforeChange({ diff --git a/src/style/abstracts/_variable.scss b/src/style/abstracts/_variable.scss index d828bc76..f2975199 100644 --- a/src/style/abstracts/_variable.scss +++ b/src/style/abstracts/_variable.scss @@ -687,9 +687,9 @@ $-swipe-indicator-height: 3px !default; // 点状指示器高 $-swipe-indicator-active-width: 12px !default; // 点状指示激活态长度 /* switch */ -$-switch-width: 51px !default; // 宽度 -$-switch-height: 32px !default; // 高度 -$-switch-circle-size: 28px !default; // 圆点大小 +$-switch-width: 1.82em !default; // 宽度 +$-switch-height: 1.14em !default; // 高度 +$-switch-circle-size: 1em !default; // 圆点大小 $-switch-border-color: #e5e5e5 !default; // 边框颜色选中状态背景颜色 $-switch-active-color: resultColor( $open-linear, diff --git a/src/style/switch.scss b/src/style/switch.scss index 225a6b94..406425de 100644 --- a/src/style/switch.scss +++ b/src/style/switch.scss @@ -24,19 +24,19 @@ display: inline-block; width: $-switch-circle-size; height: $-switch-circle-size; - top: 2px; - left: 2px; + top: 0.07em; + left: 0.07em; background: #fff; border-radius: 50%; transition: left .3s ease-out; - box-shadow: 0 2px 4px 0 $-switch-inactive-shadow-color; + box-shadow: 0 0.07em 0.14em 0 $-switch-inactive-shadow-color; &::after { position: absolute; content: ''; - width: calc(200% - 2px); - height: calc(200% - 2px); + width: calc(200% - 0.07em); + height: calc(200% - 0.07em); top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5); @@ -49,8 +49,8 @@ border-color: $-switch-active-color; .wd-switch__circle { - left: calc(#{$-switch-width - $-switch-circle-size} - 2px); - box-shadow: 0 2px 4px 0 $-switch-active-shadow-color + left: calc(#{$-switch-width - $-switch-circle-size} - 0.07em); + box-shadow: 0 0.07em 0.14em 0 $-switch-active-shadow-color } } @include when(disabled) { From 9a6c51eca01cd4f9395230930fe75f3a12ff0a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E5=AE=B6=E6=80=BF?= Date: Mon, 12 Jul 2021 14:03:40 +0800 Subject: [PATCH 2/2] fix(datetime-picker-view): this.getPickerView() is undefined and useless --- packages/datetime-picker-view/src/main.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datetime-picker-view/src/main.vue b/packages/datetime-picker-view/src/main.vue index 074a202d..57c61f18 100644 --- a/packages/datetime-picker-view/src/main.vue +++ b/packages/datetime-picker-view/src/main.vue @@ -278,7 +278,7 @@ export default { // 更新inner updateInnerValue () { - const pickerView = this.$refs.pickerView || this.getPickerView() + const pickerView = this.$refs.pickerView let values = '' values = pickerView.getValues()