File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
packages/mpx-cube-ui/src/components/slider Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 99 backgroundColor="{{ '#cccccc' }}"
1010 activeColor="{{ '#FF6430' }}"
1111 block-size="{{ 28 }}"
12+ disabled="{{false}}"
1213 show-value="{{true}}"
1314 custom-content="{{true}}"
1415 bindchange="handleChange"
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ createComponent({
218218 }
219219 } ,
220220 async onClick ( e ) {
221+ if ( this . disabled ) return
221222 const rect = await this . getRect ( )
222223 this . startDragRect = rect
223224 this . calcProgress ( e . detail . x , rect )
@@ -226,13 +227,14 @@ createComponent({
226227 this . triggerEvent ( EVENT_CHANGE , { value : this . currentValue } )
227228 } ,
228229 async startHandler ( e ) {
230+ if ( this . disabled ) return
229231 if ( __mpx_mode__ === 'web' ) {
230232 e && e . preventDefault ( )
231233 }
232234 this . startDragRect = await this . getRect ( )
233235 } ,
234236 moveHandler ( e ) {
235- if ( ! this . startDragRect ) {
237+ if ( this . disabled || ! this . startDragRect ) {
236238 return
237239 }
238240 const x = e . touches [ 0 ] . clientX
@@ -245,6 +247,7 @@ createComponent({
245247 }
246248 } ,
247249 endHandler ( ) {
250+ if ( this . disabled ) return
248251 this . startDragRect = null
249252 // 完成一次拖动后触发的事件
250253 // @arg event.detail = {value}
You can’t perform that action at this time.
0 commit comments