mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 09:52:57 +08:00
feat(Slider): add slide animation (#4700)
This commit is contained in:
parent
e1f88014d6
commit
696c9d71d5
@ -34,6 +34,12 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dragStatus: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
range() {
|
range() {
|
||||||
return this.max - this.min;
|
return this.max - this.min;
|
||||||
@ -139,6 +145,10 @@ export default createComponent({
|
|||||||
background: this.activeColor
|
background: this.activeColor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (this.dragStatus) {
|
||||||
|
barStyle.transition = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={style}
|
style={style}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background-color: @slider-active-background-color;
|
background-color: @slider-active-background-color;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
transition: width @animation-duration-fast;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__button {
|
&__button {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user