Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch组件和datetime-picker-view组件两处bug修改 #325

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/datetime-picker-view/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion packages/switch/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 3 additions & 3 deletions src/style/abstracts/_variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions src/style/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down