dpzvc3-ui 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dpzvc3.esm.js +185 -149
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +49 -22
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist-prod/index.html +1 -1
- package/dist-prod/main.717f5c8b51911571fb82.js +2 -0
- package/dist-prod/main.717f5c8b51911571fb82.js.map +1 -0
- package/package.json +2 -2
- package/src/components/action-sheet/actionSheet.vue +5 -1
- package/src/components/swipe/swipe.vue +4 -3
- package/src/lib/lib.js +22 -0
- package/dist-prod/main.bcc12e5051993020bbea.js +0 -2
- package/dist-prod/main.bcc12e5051993020bbea.js.map +0 -1
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
v-if="cancleText"
|
|
21
21
|
href="javascript:;"
|
|
22
22
|
:class="cancleClass"
|
|
23
|
-
@click="
|
|
23
|
+
@click="cancleClick"
|
|
24
24
|
>{{ cancleText }}</a>
|
|
25
25
|
</div>
|
|
26
26
|
</Popup>
|
|
@@ -80,6 +80,9 @@ export default defineComponent({
|
|
|
80
80
|
emit('update:modelValue', false)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
const cancleClick = () => {
|
|
84
|
+
emit('update:modelValue', false)
|
|
85
|
+
}
|
|
83
86
|
return {
|
|
84
87
|
visible,
|
|
85
88
|
actions,
|
|
@@ -87,6 +90,7 @@ export default defineComponent({
|
|
|
87
90
|
wrapperClasses,
|
|
88
91
|
wrapperActionClass,
|
|
89
92
|
cancleClass,
|
|
93
|
+
cancleClick,
|
|
90
94
|
emit: emitAction
|
|
91
95
|
}
|
|
92
96
|
}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
<script>
|
|
63
63
|
import { defineComponent, ref, computed, onMounted, onBeforeUnmount } from 'vue'
|
|
64
|
-
|
|
64
|
+
import rafTimeout from '../../lib/lib'
|
|
65
65
|
const prefixCls = 'dpzvc3-swipe'
|
|
66
66
|
|
|
67
67
|
export default defineComponent({
|
|
@@ -205,7 +205,7 @@ export default defineComponent({
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
function autoSlide () {
|
|
208
|
-
timer.value =
|
|
208
|
+
timer.value = rafTimeout(() => {
|
|
209
209
|
if (!dragging.value && autoSwipe.value) {
|
|
210
210
|
translateX.value -= clientWidth.value
|
|
211
211
|
console.log(slideIndex.value, maxIndex.value, 'dsdadddasdss')
|
|
@@ -233,7 +233,8 @@ export default defineComponent({
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
function clearTimer () {
|
|
236
|
-
if (timer.value) clearTimeout(timer.value)
|
|
236
|
+
// if (timer.value) clearTimeout(timer.value)
|
|
237
|
+
timer.value && timer.value()
|
|
237
238
|
timer.value = null
|
|
238
239
|
}
|
|
239
240
|
|
package/src/lib/lib.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const rafTimeout = (callback, delay) => {
|
|
2
|
+
let start = null
|
|
3
|
+
let rafId
|
|
4
|
+
|
|
5
|
+
function loop (timestamp) {
|
|
6
|
+
if (!start) start = timestamp
|
|
7
|
+
|
|
8
|
+
if (timestamp - start >= delay) {
|
|
9
|
+
callback()
|
|
10
|
+
cancelAnimationFrame(rafId)
|
|
11
|
+
} else {
|
|
12
|
+
rafId = requestAnimationFrame(loop)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
rafId = requestAnimationFrame(loop)
|
|
17
|
+
|
|
18
|
+
// 返回清除方法
|
|
19
|
+
return () => cancelAnimationFrame(rafId)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default rafTimeout
|