dpzvc3-ui 3.0.3 → 3.0.4

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.
Files changed (28) hide show
  1. package/dist/dpzvc3.esm.js +507 -522
  2. package/dist/dpzvc3.esm.js.map +1 -1
  3. package/dist/dpzvc3.esm.min.js +1 -1
  4. package/dist/dpzvc3.esm.min.js.map +1 -1
  5. package/dist/dpzvc3.js +173 -179
  6. package/dist/dpzvc3.js.map +1 -1
  7. package/dist/dpzvc3.min.js +1 -1
  8. package/dist/dpzvc3.min.js.map +1 -1
  9. package/dist-prod/91.e2fdec39667928bf57b9.js +3 -0
  10. package/dist-prod/{91.9d79b442ec3131707419.js.map → 91.e2fdec39667928bf57b9.js.map} +1 -1
  11. package/dist-prod/{cellswipe.53b0178e4638c201dcf1.chunk.js → cellswipe.04240414bed39e28e7b9.chunk.js} +2 -2
  12. package/dist-prod/{cellswipe.53b0178e4638c201dcf1.chunk.js.map → cellswipe.04240414bed39e28e7b9.chunk.js.map} +1 -1
  13. package/dist-prod/index.html +1 -1
  14. package/dist-prod/main.bcc12e5051993020bbea.js +2 -0
  15. package/dist-prod/main.bcc12e5051993020bbea.js.map +1 -0
  16. package/package.json +1 -1
  17. package/src/components/action-sheet/actionSheet.vue +8 -7
  18. package/src/components/app.vue +3 -5
  19. package/src/components/badge/badge.vue +3 -3
  20. package/src/components/cell/cell.vue +25 -5
  21. package/src/components/cell-swipe/cell-swipe.vue +5 -6
  22. package/src/components/header/header.vue +5 -4
  23. package/src/components/modal/modal.vue +3 -3
  24. package/src/components/popup/popup.vue +3 -3
  25. package/dist-prod/91.9d79b442ec3131707419.js +0 -3
  26. package/dist-prod/main.09c75d988141f805e29c.js +0 -2
  27. package/dist-prod/main.09c75d988141f805e29c.js.map +0 -1
  28. /package/dist-prod/{91.9d79b442ec3131707419.js.LICENSE.txt → 91.e2fdec39667928bf57b9.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dpzvc3-ui",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Vue组件库",
5
5
  "main": "dist/dpzvc3.js",
6
6
  "module": "dist/dpzvc3.esm.js",
@@ -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
- emit('update:modelValue', val)
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>
@@ -1,9 +1,7 @@
1
1
  <template>
2
- <div id="app">
3
- <transition :name="direction">
4
- <router-view class="page" />
5
- </transition>
6
- </div>
2
+ <transition :name="direction">
3
+ <router-view class="page" />
4
+ </transition>
7
5
  </template>
8
6
  <script>
9
7
  export default {
@@ -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
- emit('update:modelValue', val)
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>