dpzvc3-ui 3.0.0

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 (268) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +175 -0
  3. package/build-style.js +58 -0
  4. package/dist/dpzvc3.esm.js +17676 -0
  5. package/dist/dpzvc3.esm.js.map +1 -0
  6. package/dist/dpzvc3.esm.min.js +2 -0
  7. package/dist/dpzvc3.esm.min.js.map +1 -0
  8. package/dist/dpzvc3.js +15200 -0
  9. package/dist/dpzvc3.js.map +1 -0
  10. package/dist/dpzvc3.min.js +2 -0
  11. package/dist/dpzvc3.min.js.map +1 -0
  12. package/dist/styles/base/font.css +1 -0
  13. package/dist/styles/base/reset.css +1 -0
  14. package/dist/styles/base/variable.css +0 -0
  15. package/dist/styles/components/actionSheet.css +1 -0
  16. package/dist/styles/components/badge.css +1 -0
  17. package/dist/styles/components/button.css +1 -0
  18. package/dist/styles/components/card.css +1 -0
  19. package/dist/styles/components/cell-swipe.css +1 -0
  20. package/dist/styles/components/cell.css +1 -0
  21. package/dist/styles/components/checkBox.css +1 -0
  22. package/dist/styles/components/editor.css +1 -0
  23. package/dist/styles/components/header.css +1 -0
  24. package/dist/styles/components/indicator.css +1 -0
  25. package/dist/styles/components/loadmore.css +1 -0
  26. package/dist/styles/components/message.css +1 -0
  27. package/dist/styles/components/modal.css +1 -0
  28. package/dist/styles/components/number.css +1 -0
  29. package/dist/styles/components/picker.css +1 -0
  30. package/dist/styles/components/popup.css +1 -0
  31. package/dist/styles/components/progress.css +1 -0
  32. package/dist/styles/components/prompt.css +1 -0
  33. package/dist/styles/components/radioBox.css +1 -0
  34. package/dist/styles/components/slide-Bar.css +1 -0
  35. package/dist/styles/components/spinner.css +1 -0
  36. package/dist/styles/components/swipe.css +1 -0
  37. package/dist/styles/components/switchBar.css +1 -0
  38. package/dist/styles/components/tab.css +1 -0
  39. package/dist/styles/components/text.css +1 -0
  40. package/dist/styles/components/toTop.css +1 -0
  41. package/dist/styles/components/upload.css +1 -0
  42. package/dist/styles/dpzvc3.css +1 -0
  43. package/dist/styles/utils/1px.css +1 -0
  44. package/dist/styles/utils/animation.css +1 -0
  45. package/dist/styles/utils/nowrap.css +1 -0
  46. package/dist-prod/91.9d79b442ec3131707419.js +3 -0
  47. package/dist-prod/91.9d79b442ec3131707419.js.LICENSE.txt +25 -0
  48. package/dist-prod/91.9d79b442ec3131707419.js.map +1 -0
  49. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +2 -0
  50. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +1 -0
  51. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +2 -0
  52. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +1 -0
  53. package/dist-prod/button.28b491339fbba29c3f16.chunk.js +2 -0
  54. package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +1 -0
  55. package/dist-prod/card.3ad847f07bebc1391125.chunk.js +2 -0
  56. package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +1 -0
  57. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +2 -0
  58. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +1 -0
  59. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js +2 -0
  60. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js.map +1 -0
  61. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +2 -0
  62. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +1 -0
  63. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +2 -0
  64. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +1 -0
  65. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +2 -0
  66. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +1 -0
  67. package/dist-prod/index.html +19 -0
  68. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +2 -0
  69. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +1 -0
  70. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +2 -0
  71. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +1 -0
  72. package/dist-prod/main.2e9aaa9095e329ea2d7b.js +2 -0
  73. package/dist-prod/main.2e9aaa9095e329ea2d7b.js.map +1 -0
  74. package/dist-prod/message.e57fa263a214006f7191.chunk.js +2 -0
  75. package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +1 -0
  76. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +2 -0
  77. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +1 -0
  78. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +2 -0
  79. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +1 -0
  80. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +2 -0
  81. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +1 -0
  82. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +2 -0
  83. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +1 -0
  84. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +2 -0
  85. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +1 -0
  86. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +2 -0
  87. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +1 -0
  88. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +2 -0
  89. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +1 -0
  90. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +2 -0
  91. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +1 -0
  92. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +2 -0
  93. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +1 -0
  94. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js +2 -0
  95. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js.map +1 -0
  96. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +2 -0
  97. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +1 -0
  98. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +2 -0
  99. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +1 -0
  100. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +2 -0
  101. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +1 -0
  102. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +2 -0
  103. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +1 -0
  104. package/dist-prod/upload.ec7a954970889869d93e.chunk.js +2 -0
  105. package/dist-prod/upload.ec7a954970889869d93e.chunk.js.map +1 -0
  106. package/images/IMG_2614 2 2.JPG +0 -0
  107. package/images/IMG_2614.JPG +0 -0
  108. package/images/IMG_2615 2.JPG +0 -0
  109. package/images/IMG_2615.JPG +0 -0
  110. package/package.json +113 -0
  111. package/postcss.config.js +5 -0
  112. package/src/components/Indicator/Indicator.vue +82 -0
  113. package/src/components/Indicator/index.js +86 -0
  114. package/src/components/Text/Number.vue +167 -0
  115. package/src/components/Text/index.js +7 -0
  116. package/src/components/Text/textBar.vue +122 -0
  117. package/src/components/action-sheet/actionSheet.vue +93 -0
  118. package/src/components/action-sheet/index.js +5 -0
  119. package/src/components/app.vue +61 -0
  120. package/src/components/badge/badge.vue +80 -0
  121. package/src/components/badge/index.js +5 -0
  122. package/src/components/button/button.vue +111 -0
  123. package/src/components/button/index.js +5 -0
  124. package/src/components/card/card.vue +49 -0
  125. package/src/components/card/index.js +5 -0
  126. package/src/components/cell/cell.vue +93 -0
  127. package/src/components/cell/index.js +5 -0
  128. package/src/components/cell-swipe/cell-swipe.vue +169 -0
  129. package/src/components/cell-swipe/index.js +5 -0
  130. package/src/components/checkBox/checkbox-group.vue +74 -0
  131. package/src/components/checkBox/checkbox.vue +117 -0
  132. package/src/components/checkBox/index.js +8 -0
  133. package/src/components/header/header.vue +130 -0
  134. package/src/components/header/index.js +5 -0
  135. package/src/components/loadMore/index.js +5 -0
  136. package/src/components/loadMore/loadmore.vue +258 -0
  137. package/src/components/message/confirm.js +60 -0
  138. package/src/components/message/index.js +111 -0
  139. package/src/components/message/message.vue +137 -0
  140. package/src/components/message/messageGroup.vue +82 -0
  141. package/src/components/modal/confirm.js +122 -0
  142. package/src/components/modal/index.js +52 -0
  143. package/src/components/modal/modal.vue +138 -0
  144. package/src/components/picker/area-picker/area-picker.vue +230 -0
  145. package/src/components/picker/area-picker/props.js +17 -0
  146. package/src/components/picker/date-picker/date-picker.vue +191 -0
  147. package/src/components/picker/date-picker/props.js +24 -0
  148. package/src/components/picker/index.js +5 -0
  149. package/src/components/picker/normal-picker/normal-picker.vue +120 -0
  150. package/src/components/picker/normal-picker/props.js +20 -0
  151. package/src/components/picker/picker-slot.vue +217 -0
  152. package/src/components/picker/picker.vue +111 -0
  153. package/src/components/popup/index.js +5 -0
  154. package/src/components/popup/popup.vue +91 -0
  155. package/src/components/progress/index.js +5 -0
  156. package/src/components/progress/progress.vue +86 -0
  157. package/src/components/prompt/confirm.js +91 -0
  158. package/src/components/prompt/index.js +53 -0
  159. package/src/components/prompt/prompt.vue +125 -0
  160. package/src/components/radioBox/index.js +8 -0
  161. package/src/components/radioBox/radiobox-group.vue +66 -0
  162. package/src/components/radioBox/radiobox.vue +88 -0
  163. package/src/components/rater/index.js +5 -0
  164. package/src/components/rater/rater.vue +118 -0
  165. package/src/components/slideBar/index.js +6 -0
  166. package/src/components/slideBar/slideBar.vue +207 -0
  167. package/src/components/spinner/behavior/blade.vue +42 -0
  168. package/src/components/spinner/behavior/double-bounce.vue +38 -0
  169. package/src/components/spinner/behavior/fading-circle.vue +55 -0
  170. package/src/components/spinner/behavior/snake.vue +41 -0
  171. package/src/components/spinner/behavior/triple-bounce.vue +52 -0
  172. package/src/components/spinner/index.js +5 -0
  173. package/src/components/spinner/props.js +28 -0
  174. package/src/components/spinner/spinner.vue +78 -0
  175. package/src/components/swipe/index.js +5 -0
  176. package/src/components/swipe/swipe.vue +281 -0
  177. package/src/components/switchbar/index.js +5 -0
  178. package/src/components/switchbar/switchbar.vue +79 -0
  179. package/src/components/tab/index.js +6 -0
  180. package/src/components/tab/tab.vue +89 -0
  181. package/src/components/toTop/index.js +5 -0
  182. package/src/components/toTop/topTop.vue +78 -0
  183. package/src/components/upload/index.js +5 -0
  184. package/src/components/upload/upload.vue +166 -0
  185. package/src/config/config.js +16 -0
  186. package/src/directives/clickoutside.js +42 -0
  187. package/src/directives/tranferDom.js +66 -0
  188. package/src/index.js +149 -0
  189. package/src/lib/MegaPixImage.js +163 -0
  190. package/src/lib/MegaPixImageOld.js +153 -0
  191. package/src/lib/exif-js.js +235 -0
  192. package/src/lib/exif.js +789 -0
  193. package/src/main.js +31 -0
  194. package/src/mixin/emitter.js +72 -0
  195. package/src/mixin/input.js +41 -0
  196. package/src/router.js +36 -0
  197. package/src/styles/base/font.less +99 -0
  198. package/src/styles/base/reset.less +135 -0
  199. package/src/styles/base/variable.less +108 -0
  200. package/src/styles/components/actionSheet.less +43 -0
  201. package/src/styles/components/badge.less +81 -0
  202. package/src/styles/components/button.less +124 -0
  203. package/src/styles/components/card.less +31 -0
  204. package/src/styles/components/cell-swipe.less +20 -0
  205. package/src/styles/components/cell.less +75 -0
  206. package/src/styles/components/checkBox.less +113 -0
  207. package/src/styles/components/editor.less +3 -0
  208. package/src/styles/components/header.less +72 -0
  209. package/src/styles/components/indicator.less +39 -0
  210. package/src/styles/components/loadmore.less +48 -0
  211. package/src/styles/components/message.less +57 -0
  212. package/src/styles/components/modal.less +84 -0
  213. package/src/styles/components/number.less +60 -0
  214. package/src/styles/components/picker.less +152 -0
  215. package/src/styles/components/popup.less +46 -0
  216. package/src/styles/components/progress.less +52 -0
  217. package/src/styles/components/prompt.less +37 -0
  218. package/src/styles/components/radioBox.less +138 -0
  219. package/src/styles/components/slide-Bar.less +149 -0
  220. package/src/styles/components/spinner.less +329 -0
  221. package/src/styles/components/swipe.less +125 -0
  222. package/src/styles/components/switchBar.less +88 -0
  223. package/src/styles/components/tab.less +71 -0
  224. package/src/styles/components/text.less +82 -0
  225. package/src/styles/components/toTop.less +28 -0
  226. package/src/styles/components/upload.less +23 -0
  227. package/src/styles/index.less +38 -0
  228. package/src/styles/utils/1px.less +206 -0
  229. package/src/styles/utils/animation.less +165 -0
  230. package/src/styles/utils/nowrap.less +19 -0
  231. package/src/template/index.ejs +40 -0
  232. package/src/utils/util.js +202 -0
  233. package/src/vconsole-resources.min.js +6 -0
  234. package/src/vconsole-sources.min.js +6 -0
  235. package/src/vconsole.min.js +7 -0
  236. package/src/views/ActionSheet.vue +46 -0
  237. package/src/views/Badge.vue +51 -0
  238. package/src/views/Button.vue +69 -0
  239. package/src/views/Card.vue +88 -0
  240. package/src/views/Cell.vue +30 -0
  241. package/src/views/CellSwipe.vue +68 -0
  242. package/src/views/CheckBox.vue +77 -0
  243. package/src/views/Header.vue +70 -0
  244. package/src/views/Indicator.vue +82 -0
  245. package/src/views/LoadMore.vue +73 -0
  246. package/src/views/Message.vue +61 -0
  247. package/src/views/Modal.vue +69 -0
  248. package/src/views/Picker.vue +140 -0
  249. package/src/views/Popup.vue +97 -0
  250. package/src/views/Progress.vue +47 -0
  251. package/src/views/Prompt.vue +43 -0
  252. package/src/views/RadioBox.vue +68 -0
  253. package/src/views/Rater.vue +49 -0
  254. package/src/views/SlideBar.vue +55 -0
  255. package/src/views/Spinner.vue +15 -0
  256. package/src/views/Swipe.vue +59 -0
  257. package/src/views/SwitchBar.vue +47 -0
  258. package/src/views/Tab.vue +53 -0
  259. package/src/views/Text.vue +93 -0
  260. package/src/views/ToTop.vue +17 -0
  261. package/src/views/Upload.vue +61 -0
  262. package/src/views/guide.vue +164 -0
  263. package/src/views/index.vue +554 -0
  264. package/webpack.base.config.js +65 -0
  265. package/webpack.dev.config.js +42 -0
  266. package/webpack.dist.dev.config.js +75 -0
  267. package/webpack.dist.prod.config.js +89 -0
  268. package/webpack.prod.config.js +51 -0
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="CardDemo">
3
+ <!-- 基础卡片 -->
4
+ <Card width="80%">
5
+ <template #header>
6
+ <h3 class="item">
7
+ 卡片头部
8
+ </h3>
9
+ </template>
10
+ <template #default>
11
+ <p class="item-main">
12
+ 这里是卡片内容
13
+ </p>
14
+ </template>
15
+ <template #footer>
16
+ <span class="item">
17
+ <button @click="onClick">
18
+ 操作按钮
19
+ </button>
20
+ </span>
21
+ </template>
22
+ </Card>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import { ref } from 'vue'
28
+ // import Card from '../components/card'
29
+
30
+ export default {
31
+ name: 'ViewCard',
32
+ setup () {
33
+ const count = ref(0)
34
+
35
+ const onClick = () => {
36
+ count.value += 1
37
+ console.log('点击了第一张卡片按钮', count.value)
38
+ }
39
+
40
+ const onClick2 = () => {
41
+ count.value += 2
42
+ console.log('点击了第二张卡片按钮', count.value)
43
+ }
44
+
45
+ return {
46
+ count,
47
+ onClick,
48
+ onClick2
49
+ }
50
+ }
51
+ }
52
+ </script>
53
+
54
+ <style lang="less" scoped>
55
+ .CardDemo {
56
+ background: #4d4d4d;
57
+ width: 100%;
58
+ height: 100%;
59
+ display: flex;
60
+ flex-direction: row;
61
+ justify-content: center;
62
+ align-items: center;
63
+ .item {
64
+ width: 100%;
65
+ height: 100%;
66
+ ;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ }
71
+ .item-main {
72
+ width: 100%;
73
+ height: 200px;
74
+
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ }
79
+ button {
80
+ padding: 4px 12px;
81
+ background-color: #409eff;
82
+ color: #fff;
83
+ border: none;
84
+ border-radius: 4px;
85
+ cursor: pointer;
86
+ }
87
+ }
88
+ </style>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div class="Cell">
3
+ <Cell
4
+ title="Guide"
5
+ label="导航"
6
+ link="/guide"
7
+ value="跳转到导航页"
8
+ />
9
+ <Cell
10
+ title="Index"
11
+ label="主页"
12
+ link="/guide"
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+
19
+ export default {
20
+ name: 'ViewCell'
21
+
22
+ }
23
+ </script>
24
+
25
+ <style lang="less" scoped>
26
+ .Cell {
27
+ width: 100%;
28
+ position: relative;
29
+ }
30
+ </style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div class="CellSwipe">
3
+ <CellSwipe
4
+ :right="right"
5
+ title="向左滑"
6
+ has-mask
7
+ />
8
+ <CellSwipe
9
+ :left="left"
10
+ title="向右滑"
11
+ has-mask
12
+ />
13
+ <template v-if="show">
14
+ <CellSwipe
15
+ :left="left"
16
+ :right="right"
17
+ title="删除测试"
18
+ has-mask
19
+ />
20
+ </template>
21
+ </div>
22
+ </template>
23
+
24
+ <script setup>
25
+ import { reactive, ref, getCurrentInstance } from 'vue'
26
+ import CellSwipe from '../components/cell-swipe'
27
+
28
+ const show = ref(true)
29
+ const { proxy } = getCurrentInstance() // 用于访问全局 Modal
30
+
31
+ const left = reactive([
32
+ {
33
+ content: '确定',
34
+ style: { backgroundColor: '#eee', color: '#fff' },
35
+ handleClick: () => {
36
+ proxy.$Modal.info({ body: '点击了确定' })
37
+ }
38
+ },
39
+ {
40
+ content: '删除',
41
+ style: { backgroundColor: 'red', color: '#fff' },
42
+ handleClick: () => {
43
+ proxy.$Modal.info({ body: '点击了删除' })
44
+ }
45
+ }
46
+ ])
47
+
48
+ const right = reactive([
49
+ {
50
+ content: '确定',
51
+ style: { backgroundColor: '#eee', color: '#fff' },
52
+ handleClick: () => {
53
+ proxy.$Modal.info({ body: '点击了确定' })
54
+ }
55
+ },
56
+ {
57
+ content: '删除',
58
+ style: { backgroundColor: 'red', color: '#fff' },
59
+ handleClick: () => {
60
+ proxy.$Modal.info({ body: '点击了删除' })
61
+ }
62
+ }
63
+ ])
64
+ </script>
65
+
66
+ <style scoped>
67
+ /* 可自行添加样式 */
68
+ </style>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <div class="CheckBox">
3
+ <p>checkbox 组合</p>
4
+ <div class="item">
5
+ <CheckBoxGroup v-model="data">
6
+ <CheckBox label="中国" />
7
+ <CheckBox label="美国" />
8
+ <CheckBox label="日本" />
9
+ </CheckBoxGroup>
10
+ </div>
11
+
12
+ <div class="item">
13
+ value: {{ data }}
14
+ </div>
15
+
16
+ <p>单个 checkbox</p>
17
+ <div class="item">
18
+ <CheckBox
19
+ v-model="checked"
20
+ label="苹果"
21
+ @onChange="change"
22
+ />
23
+ </div>
24
+
25
+ <div class="item">
26
+ checked: {{ checked }}
27
+ </div>
28
+
29
+ <p>禁用的 checkbox</p>
30
+ <div class="item">
31
+ <CheckBox
32
+ label="玩具"
33
+ disable
34
+ />
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ import { defineComponent, ref } from 'vue'
41
+
42
+ export default defineComponent({
43
+ name: 'ViewCheckBox',
44
+
45
+ setup () {
46
+ const data = ref(['中国'])
47
+ const checked = ref(false)
48
+ const change = (e) => {
49
+ console.log(e, 'e')
50
+ }
51
+ return {
52
+ data,
53
+ change,
54
+ checked
55
+ }
56
+ }
57
+ })
58
+ </script>
59
+
60
+ <style lang="less" scoped>
61
+ .CheckBox {
62
+ padding-top: 100px;
63
+
64
+ p {
65
+ width: 100%;
66
+ font-weight: bold;
67
+ font-size: 16px;
68
+ margin: 20px 0;
69
+ }
70
+
71
+ .item {
72
+ width: 100%;
73
+ display: flex;
74
+ justify-content: center;
75
+ }
76
+ }
77
+ </style>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div class="Header">
3
+ <!-- 默认 Header -->
4
+ <div class="item">
5
+ <DpHeader
6
+ title="Header"
7
+ :fixed="fixed"
8
+ />
9
+ </div>
10
+
11
+ <!-- Header 右侧自定义 -->
12
+ <div class="item">
13
+ <DpHeader
14
+ title="Header"
15
+ :fixed="fixed"
16
+ >
17
+ <template #right>
18
+ <span @click="share">分享</span>
19
+ </template>
20
+ </DpHeader>
21
+ </div>
22
+
23
+ <!-- Header 左右自定义 -->
24
+ <div class="item">
25
+ <DpHeader
26
+ title="Header"
27
+ :fixed="fixed"
28
+ >
29
+ <template #left>
30
+ <span>返回</span>
31
+ </template>
32
+ <template #right>
33
+ <span @click="share">分享</span>
34
+ </template>
35
+ </DpHeader>
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <script>
41
+ import { ref, getCurrentInstance } from 'vue'
42
+
43
+ export default {
44
+ name: 'ViewHeader',
45
+ setup () {
46
+ const { proxy } = getCurrentInstance()
47
+ const fixed = ref(false)
48
+
49
+ const share = () => {
50
+ // 假设 $Modal 已经在全局挂载
51
+ if (proxy) {
52
+ proxy.$Modal.confirm({
53
+ showHead: false,
54
+ body: '点击了分享'
55
+ })
56
+ }
57
+ }
58
+
59
+ return { fixed, share }
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <style scoped>
65
+ .item {
66
+ position: relative;
67
+ margin-bottom: 20px;
68
+ height: 50px;
69
+ }
70
+ </style>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div class="Indicator">
3
+ <div class="item">
4
+ <VButton @click="blade">
5
+ blade
6
+ </VButton>
7
+ </div>
8
+ <div class="item">
9
+ <VButton @click="snake">
10
+ snake
11
+ </VButton>
12
+ </div>
13
+ <div class="item">
14
+ <VButton @click="circle">
15
+ circle
16
+ </VButton>
17
+ </div>
18
+ <div class="item">
19
+ <VButton @click="bounce">
20
+ bounce
21
+ </VButton>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import { defineComponent, getCurrentInstance } from 'vue'
28
+
29
+ export default defineComponent({
30
+ name: 'ViewIndicator',
31
+ setup () {
32
+ const { proxy } = getCurrentInstance()
33
+ const removeAfterDelay = (duration = 3000) => {
34
+ setTimeout(() => {
35
+ proxy.$Indicator.remove()
36
+ }, duration)
37
+ }
38
+
39
+ const blade = () => {
40
+ proxy.$Indicator.blade()
41
+ removeAfterDelay()
42
+ }
43
+
44
+ const snake = () => {
45
+ proxy.$Indicator.snake()
46
+ removeAfterDelay()
47
+ }
48
+
49
+ const circle = () => {
50
+ proxy.$Indicator.circle()
51
+ removeAfterDelay()
52
+ }
53
+
54
+ const bounce = () => {
55
+ proxy.$Indicator.bounce()
56
+ removeAfterDelay()
57
+ }
58
+
59
+ return {
60
+ blade,
61
+ snake,
62
+ circle,
63
+ bounce
64
+ }
65
+ }
66
+ })
67
+ </script>
68
+
69
+ <style lang="less" scoped>
70
+ .Indicator {
71
+ height: 100%;
72
+ display: flex;
73
+ justify-content: space-around;
74
+ flex-direction: column;
75
+ align-items: center;
76
+
77
+ .item {
78
+ margin: 0 auto;
79
+ width: 50%;
80
+ }
81
+ }
82
+ </style>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div class="LoadMore">
3
+ <LoadMore
4
+ ref="moreRef"
5
+ :refresh="topMethod"
6
+ height="100%"
7
+ :load-more="bottomMethod"
8
+ :has-more="hasMore"
9
+ @on-change-up-status="getStatus"
10
+ >
11
+ <div
12
+ v-for="(item, index) in loadmore"
13
+ :key="index"
14
+ style="width: 100%; height: 50px;"
15
+ >
16
+ {{ item }}
17
+ </div>
18
+ </LoadMore>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import { defineComponent, ref } from 'vue'
24
+
25
+ export default defineComponent({
26
+ name: 'ViewLoadMore',
27
+ setup () {
28
+ const moreRef = ref(null)
29
+ const hasMore = ref(true)
30
+ const loadmore = ref(Array(16).fill('LoadMore'))
31
+
32
+ const topMethod = () => {
33
+ hasMore.value = true
34
+
35
+ setTimeout(() => {
36
+ if (moreRef.value && moreRef.value.onLoadOff) {
37
+ moreRef.value.onLoadOff()
38
+ }
39
+ }, 2000)
40
+ }
41
+
42
+ const bottomMethod = () => {
43
+ setTimeout(() => {
44
+ if (moreRef.value && moreRef.value.onLoadOff) {
45
+ moreRef.value.onLoadOff()
46
+ }
47
+ loadmore.value.push(...['LoadMore', 'LoadMore'])
48
+ }, 2000)
49
+ }
50
+
51
+ const getStatus = (val) => {
52
+ console.log(val)
53
+ }
54
+
55
+ return {
56
+ moreRef,
57
+ hasMore,
58
+ loadmore,
59
+ topMethod,
60
+ bottomMethod,
61
+ getStatus
62
+ }
63
+ }
64
+ })
65
+ </script>
66
+
67
+ <style lang="less" scoped>
68
+ .LoadMore {
69
+ width: 100%;
70
+ height: 100%;
71
+ overflow: auto;
72
+ }
73
+ </style>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div class="Message">
3
+ <VButton
4
+ width="50%"
5
+ @click="showMessageTop"
6
+ >
7
+ Top
8
+ </VButton>
9
+ <VButton
10
+ width="50%"
11
+ @click="showMessage"
12
+ >
13
+ Center
14
+ </VButton>
15
+ <VButton
16
+ width="50%"
17
+ @click="showMessageBottom"
18
+ >
19
+ Bottom
20
+ </VButton>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { getCurrentInstance } from 'vue'
26
+
27
+ export default {
28
+ name: 'ViewMessage',
29
+ setup () {
30
+ // 获取全局实例
31
+ const { proxy } = getCurrentInstance()
32
+ const showMessage = () => {
33
+ proxy.$Message.show({ text: '显示消息' })
34
+ }
35
+
36
+ const showMessageTop = () => {
37
+ proxy.$Message.show({ text: '显示消息', position: 'top' })
38
+ }
39
+
40
+ const showMessageBottom = () => {
41
+ proxy.$Message.show({ text: '显示消息', position: 'bottom' })
42
+ }
43
+
44
+ return {
45
+ showMessage,
46
+ showMessageTop,
47
+ showMessageBottom
48
+ }
49
+ }
50
+ }
51
+ </script>
52
+
53
+ <style scoped>
54
+ .Message {
55
+ height: 100%;
56
+ display: flex;
57
+ justify-content: space-around;
58
+ flex-direction: column;
59
+ align-items: center;
60
+ }
61
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div class="Modal">
3
+ <VButton
4
+ width="50%"
5
+ @click="showInfo"
6
+ >
7
+ info
8
+ </VButton>
9
+ <VButton
10
+ width="50%"
11
+ @click="showConfirm"
12
+ >
13
+ confirm
14
+ </VButton>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import { getCurrentInstance } from 'vue'
20
+ import VButton from '../components/button'
21
+
22
+ export default {
23
+ name: 'ViewModal',
24
+ components: { VButton },
25
+ setup () {
26
+ // 获取实例,用来访问全局属性 $Modal / $Message
27
+ const { proxy } = getCurrentInstance()
28
+
29
+ const showInfo = () => {
30
+ proxy.$Modal.info({
31
+ body: '这是内容',
32
+ onOk: function () {
33
+ proxy.$Message.show({ text: '点击了确定' })
34
+ // console.log('点击了确定')
35
+ },
36
+ onCancle: function () {
37
+ proxy.$Message.show({ text: '点击了取消' })
38
+ // console.log('点击了取消')
39
+ }
40
+ })
41
+ }
42
+
43
+ const showConfirm = () => {
44
+ proxy.$Modal.confirm({
45
+ body: '这是内容',
46
+ onOk: function () {
47
+ proxy.$Message.show({ text: '点击了确定' })
48
+ // console.log('点击了确定')
49
+ }
50
+ })
51
+ }
52
+
53
+ return {
54
+ showInfo,
55
+ showConfirm
56
+ }
57
+ }
58
+ }
59
+ </script>
60
+
61
+ <style lang="less" scoped>
62
+ .Modal {
63
+ height: 100%;
64
+ display: flex;
65
+ justify-content: space-around;
66
+ flex-direction: column;
67
+ align-items: center;
68
+ }
69
+ </style>