Commit f2be585e5ee594f9e76ba711929ff63f75b5ef48

Authored by 梁灏
1 parent 73772536

optimize Slider when dragging can select content in page

optimize Slider when dragging can select content in page
src/components/slider/slider.vue
... ... @@ -253,6 +253,7 @@
253 253 // for single use
254 254 onSingleButtonDown (event) {
255 255 if (this.disabled) return;
  256 + event.preventDefault();
256 257 this.onSingleDragStart(event);
257 258 window.addEventListener('mousemove', this.onSingleDragging);
258 259 window.addEventListener('mouseup', this.onSingleDragEnd);
... ... @@ -306,6 +307,7 @@
306 307 // for range use first
307 308 onFirstButtonDown (event) {
308 309 if (this.disabled) return;
  310 + event.preventDefault();
309 311 this.onFirstDragStart(event);
310 312 window.addEventListener('mousemove', this.onFirstDragging);
311 313 window.addEventListener('mouseup', this.onFirstDragEnd);
... ... @@ -354,6 +356,7 @@
354 356 // for range use second
355 357 onSecondButtonDown (event) {
356 358 if (this.disabled) return;
  359 + event.preventDefault();
357 360 this.onSecondDragStart(event);
358 361 window.addEventListener('mousemove', this.onSecondDragging);
359 362 window.addEventListener('mouseup', this.onSecondDragEnd);
... ...
test/routers/slider.vue
... ... @@ -8,6 +8,7 @@
8 8 <!--<Slider :step="13"></Slider>-->
9 9 <!--<Slider :step="13" :max="60"></Slider>-->
10 10 <Icon type="checkmark-circled" size="40" color="#f60"></Icon>
  11 + <p>附近的首付款是东方红看就是</p>
11 12 </div>
12 13 </template>
13 14 <script>
... ...