= num
+ : mergedValue >= num,
+ label: marks[key],
style: {
- left:
- ((Number(value) - this.min) / (this.max - this.min)) * 100 + '%'
+ left: ((num - min) / (max - min)) * 100 + '%'
}
})
}
- return marks
+ return mergedMarks
},
fillStyle () {
if (this.range) {
@@ -351,6 +365,13 @@ export default {
watch: {
mergedValue (newValue, oldValue) {
const { changeSource } = this
+ if (this.marks) {
+ if (this.dotTransitionDisabled) return
+ this.dotTransitionDisabled = true
+ this.$nextTick(() => {
+ this.dotTransitionDisabled = false
+ })
+ }
if (this.range && newValue) {
if (oldValue && oldValue[1] !== newValue[1]) {
this.$nextTick(() => {
diff --git a/src/slider/src/styles/themed-base.cssr.js b/src/slider/src/styles/themed-base.cssr.js
index 4a68555f4..0a5f77b1c 100644
--- a/src/slider/src/styles/themed-base.cssr.js
+++ b/src/slider/src/styles/themed-base.cssr.js
@@ -28,7 +28,8 @@ export default c([
dotWidth,
dotBorderRadius,
indicatorBorderRadius,
- fontSize
+ fontSize,
+ dotBorderActive
},
$global: {
cubicBezierEaseInOut,
@@ -50,8 +51,8 @@ export default c([
raw: `
position: absolute;
top: 18px;
- left: 0;
- right: 0;
+ left: calc(${handleSize} / 2);
+ right: calc(${handleSize} / 2);
`
}, [
cB('slider-mark', {
@@ -137,11 +138,16 @@ export default c([
cB('slider-dots', {
raw: `
position: absolute;
- left: 0;
top: 50%;
- right: 0;
+ left: calc(${handleSize} / 2);
+ right: calc(${handleSize} / 2);
`
}, [
+ cM('transition-disabled', [
+ cB('slider-dot', {
+ transition: 'none'
+ })
+ ]),
cB('slider-dot', {
raw: `
transition:
@@ -159,7 +165,11 @@ export default c([
border: dotBorder,
backgroundColor: dotColor,
boxShadow: dotBoxShadow
- })
+ }, [
+ cM('active', {
+ border: dotBorderActive
+ })
+ ])
])
]),
cTB('slider-handle-indicator', {
diff --git a/src/slider/styles/dark.js b/src/slider/styles/dark.js
index d5efc7e47..01e89c807 100644
--- a/src/slider/styles/dark.js
+++ b/src/slider/styles/dark.js
@@ -36,7 +36,8 @@ export default create({
indicatorBoxShadow: boxShadow,
indicatorTextColor: textColor2Overlay,
indicatorBorderRadius: borderRadius,
- dotBorder: `2px solid ${primaryColorSuppl}`,
+ dotBorder: `2px solid ${railColorOverlay}`,
+ dotBorderActive: `2px solid ${primaryColorSuppl}`,
dotBoxShadow: null
}
}
diff --git a/src/slider/styles/light.js b/src/slider/styles/light.js
index fa99d2570..1b8140be2 100644
--- a/src/slider/styles/light.js
+++ b/src/slider/styles/light.js
@@ -39,7 +39,8 @@ export default create({
indicatorBoxShadow: boxShadow,
indicatorTextColor: baseColor,
indicatorBorderRadius: borderRadius,
- dotBorder: `2px solid ${primaryColor}`,
+ dotBorder: `2px solid ${railColorOverlay}`,
+ dotBorderActive: `2px solid ${primaryColor}`,
dotBoxShadow: null
}
}