dpzvc3-ui 3.0.3 → 3.0.5
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 +668 -651
- 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 +212 -195
- 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/91.e2fdec39667928bf57b9.js +3 -0
- package/dist-prod/{91.9d79b442ec3131707419.js.map → 91.e2fdec39667928bf57b9.js.map} +1 -1
- package/dist-prod/{cellswipe.53b0178e4638c201dcf1.chunk.js → cellswipe.04240414bed39e28e7b9.chunk.js} +2 -2
- package/dist-prod/{cellswipe.53b0178e4638c201dcf1.chunk.js.map → cellswipe.04240414bed39e28e7b9.chunk.js.map} +1 -1
- package/dist-prod/index.html +1 -1
- package/dist-prod/main.ca76d714164efdce0339.js +2 -0
- package/dist-prod/main.ca76d714164efdce0339.js.map +1 -0
- package/package.json +2 -2
- package/src/components/action-sheet/actionSheet.vue +8 -7
- package/src/components/app.vue +3 -5
- package/src/components/badge/badge.vue +3 -3
- package/src/components/cell/cell.vue +25 -5
- package/src/components/cell-swipe/cell-swipe.vue +5 -6
- package/src/components/header/header.vue +5 -4
- package/src/components/modal/modal.vue +3 -3
- package/src/components/popup/popup.vue +3 -3
- package/src/components/swipe/swipe.vue +4 -3
- package/src/lib/lib.js +22 -0
- package/dist-prod/91.9d79b442ec3131707419.js +0 -3
- package/dist-prod/main.09c75d988141f805e29c.js +0 -2
- package/dist-prod/main.09c75d988141f805e29c.js.map +0 -1
- /package/dist-prod/{91.9d79b442ec3131707419.js.LICENSE.txt → 91.e2fdec39667928bf57b9.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script>
|
|
31
|
-
import { ref, computed, watch } from 'vue'
|
|
31
|
+
import { ref, computed, watch, defineComponent } from 'vue'
|
|
32
32
|
import Popup from '../popup'
|
|
33
33
|
|
|
34
34
|
const prefixCls = 'dpzvc3-actionSheet'
|
|
35
35
|
|
|
36
|
-
export default {
|
|
36
|
+
export default defineComponent({
|
|
37
37
|
name: 'ActionSheet',
|
|
38
38
|
components: { Popup },
|
|
39
39
|
props: {
|
|
@@ -61,9 +61,9 @@ export default {
|
|
|
61
61
|
})
|
|
62
62
|
|
|
63
63
|
// 监听 visible 改变,通知父组件
|
|
64
|
-
watch(visible, (val) => {
|
|
65
|
-
|
|
66
|
-
})
|
|
64
|
+
// watch(visible, (val) => {
|
|
65
|
+
// emit('update:modelValue', val)
|
|
66
|
+
// })
|
|
67
67
|
|
|
68
68
|
// 样式类
|
|
69
69
|
const classes = computed(() => [prefixCls])
|
|
@@ -76,7 +76,8 @@ export default {
|
|
|
76
76
|
if (item.onClick && typeof item.onClick === 'function') {
|
|
77
77
|
item.onClick(item, index)
|
|
78
78
|
}
|
|
79
|
-
visible.value = false
|
|
79
|
+
// visible.value = false
|
|
80
|
+
emit('update:modelValue', false)
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
return {
|
|
@@ -89,5 +90,5 @@ export default {
|
|
|
89
90
|
emit: emitAction
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
}
|
|
93
|
+
})
|
|
93
94
|
</script>
|
package/src/components/app.vue
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
import { computed, ref, watch } from 'vue'
|
|
12
|
+
import { computed, ref, watch, defineComponent } from 'vue'
|
|
13
13
|
|
|
14
14
|
const prefixCls = 'dpzvc3-badge'
|
|
15
15
|
|
|
16
|
-
export default {
|
|
16
|
+
export default defineComponent({
|
|
17
17
|
name: 'Dpzvc3Badge',
|
|
18
18
|
props: {
|
|
19
19
|
type: {
|
|
@@ -76,5 +76,5 @@ export default {
|
|
|
76
76
|
displayCount
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
})
|
|
80
80
|
</script>
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
:href="toLink"
|
|
4
4
|
:class="classes"
|
|
5
5
|
@click.prevent="handleClick"
|
|
6
|
+
@touchstart="cellTouchStart"
|
|
7
|
+
@touchmove="cellTouchMove"
|
|
8
|
+
@touchend="cellTouchEnd"
|
|
6
9
|
>
|
|
7
10
|
<span
|
|
8
11
|
v-if="hasMask"
|
|
@@ -35,12 +38,12 @@
|
|
|
35
38
|
</template>
|
|
36
39
|
|
|
37
40
|
<script>
|
|
38
|
-
import { computed } from 'vue'
|
|
41
|
+
import { computed, defineComponent } from 'vue'
|
|
39
42
|
import { useRouter } from 'vue-router'
|
|
40
43
|
|
|
41
44
|
const prefixCls = 'dpzvc3-cell'
|
|
42
45
|
|
|
43
|
-
export default {
|
|
46
|
+
export default defineComponent({
|
|
44
47
|
name: 'Dpzvc3Cell',
|
|
45
48
|
props: {
|
|
46
49
|
title: String,
|
|
@@ -49,6 +52,7 @@ export default {
|
|
|
49
52
|
link: String,
|
|
50
53
|
hasMask: Boolean
|
|
51
54
|
},
|
|
55
|
+
emits: ['touchstart', 'touchmove', 'touchend', 'click'],
|
|
52
56
|
setup (props, { emit }) {
|
|
53
57
|
const router = useRouter()
|
|
54
58
|
|
|
@@ -72,7 +76,20 @@ export default {
|
|
|
72
76
|
|
|
73
77
|
// 点击跳转
|
|
74
78
|
const handleClick = (e) => {
|
|
75
|
-
if (props.link) router.push(props.link)
|
|
79
|
+
if (props.link) { router.push(props.link) } else {
|
|
80
|
+
emit('click', e)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 定义touchstart,touchmove,touchend事件
|
|
85
|
+
const cellTouchStart = (e) => {
|
|
86
|
+
emit('touchstart', e)
|
|
87
|
+
}
|
|
88
|
+
const cellTouchMove = (e) => {
|
|
89
|
+
emit('touchmove', e)
|
|
90
|
+
}
|
|
91
|
+
const cellTouchEnd = (e) => {
|
|
92
|
+
emit('touchend', e)
|
|
76
93
|
}
|
|
77
94
|
|
|
78
95
|
return {
|
|
@@ -86,8 +103,11 @@ export default {
|
|
|
86
103
|
valueClass,
|
|
87
104
|
labelClass,
|
|
88
105
|
handleClick,
|
|
89
|
-
emit
|
|
106
|
+
emit,
|
|
107
|
+
cellTouchStart,
|
|
108
|
+
cellTouchMove,
|
|
109
|
+
cellTouchEnd
|
|
90
110
|
}
|
|
91
111
|
}
|
|
92
|
-
}
|
|
112
|
+
})
|
|
93
113
|
</script>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Cell
|
|
3
3
|
ref="cell"
|
|
4
|
-
v-clickoutside:touchstart="swipe"
|
|
5
4
|
:title="title"
|
|
6
5
|
:value="value"
|
|
7
6
|
:label="label"
|
|
@@ -47,14 +46,14 @@
|
|
|
47
46
|
</template>
|
|
48
47
|
|
|
49
48
|
<script>
|
|
50
|
-
import { ref, reactive, onMounted, watch, nextTick } from 'vue'
|
|
49
|
+
import { ref, reactive, onMounted, watch, nextTick, defineComponent } from 'vue'
|
|
51
50
|
import Cell from '../cell'
|
|
52
|
-
import Clickoutside from '../../directives/clickoutside'
|
|
51
|
+
// import Clickoutside from '../../directives/clickoutside'
|
|
53
52
|
|
|
54
|
-
export default {
|
|
53
|
+
export default defineComponent({
|
|
55
54
|
name: 'CellSwipe',
|
|
56
55
|
components: { Cell },
|
|
57
|
-
directives: { Clickoutside },
|
|
56
|
+
// directives: { Clickoutside },
|
|
58
57
|
props: {
|
|
59
58
|
title: String,
|
|
60
59
|
value: {},
|
|
@@ -165,5 +164,5 @@ export default {
|
|
|
165
164
|
onTouchEnd
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
|
-
}
|
|
167
|
+
})
|
|
169
168
|
</script>
|
|
@@ -93,9 +93,9 @@ export default defineComponent({
|
|
|
93
93
|
}
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
watch(visible, val => {
|
|
97
|
-
|
|
98
|
-
})
|
|
96
|
+
// watch(visible, val => {
|
|
97
|
+
// emit('update:modelValue', val)
|
|
98
|
+
// })
|
|
99
99
|
|
|
100
100
|
watch(
|
|
101
101
|
() => props.wechat,
|
|
@@ -107,7 +107,8 @@ export default defineComponent({
|
|
|
107
107
|
/** mounted 逻辑 */
|
|
108
108
|
onMounted(() => {
|
|
109
109
|
if ((isWeixin.value || isPcWeixin.value) && !isWechat.value) {
|
|
110
|
-
visible.value = false
|
|
110
|
+
// visible.value = false
|
|
111
|
+
emit('update:modelValue', false)
|
|
111
112
|
}
|
|
112
113
|
})
|
|
113
114
|
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
</template>
|
|
67
67
|
|
|
68
68
|
<script>
|
|
69
|
-
import { ref, computed, watch } from 'vue'
|
|
69
|
+
import { ref, computed, watch, defineComponent } from 'vue'
|
|
70
70
|
import VButton from '../button'
|
|
71
71
|
|
|
72
|
-
export default {
|
|
72
|
+
export default defineComponent({
|
|
73
73
|
name: 'Dpzvc3Modal',
|
|
74
74
|
components: { VButton },
|
|
75
75
|
props: {
|
|
@@ -134,5 +134,5 @@ export default {
|
|
|
134
134
|
ok
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
}
|
|
137
|
+
})
|
|
138
138
|
</script>
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
import { ref, computed, watch } from 'vue'
|
|
24
|
+
import { ref, computed, watch, defineComponent } from 'vue'
|
|
25
25
|
|
|
26
26
|
const prefixCls = 'dpzvc3-popup'
|
|
27
27
|
|
|
28
|
-
export default {
|
|
28
|
+
export default defineComponent({
|
|
29
29
|
name: 'Dpzvc3Popup',
|
|
30
30
|
props: {
|
|
31
31
|
modelValue: { // Vue 3 v-model 默认绑定
|
|
@@ -87,5 +87,5 @@ export default {
|
|
|
87
87
|
close
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
})
|
|
91
91
|
</script>
|
|
@@ -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
|