You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
export default {
data ( ) {
return {
sliderRect : { } ,
info : {
width : null ,
left : null ,
step : this . step ,
disabled : this . disabled ,
min : this . min ,
max : this . max ,
value : this . value
}
}
} ,
mounted ( ) {
this . init ( )
} ,
methods : {
init ( ) {
this . getSliderRect ( )
} ,
// 获取slider尺寸
getSliderRect ( ) {
// 获取滑块条的尺寸信息
uni . $u . sleep ( ) . then ( ( ) => {
this . $uGetRect ( '.u-slider' ) . then ( ( rect ) => {
this . info . width = rect . width
this . info . left = rect . left
} )
} )
} ,
// 此方法由wxs调用, 用于修改v-model绑定的值
updateValue ( value ) {
this . $emit ( 'input' , value )
} ,
// 此方法由wxs调用, 发出事件
emitEvent ( e ) {
this . $emit ( e . event , e . value ? e . value : this . value )
}
}
}