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.
- package/LICENSE +20 -0
- package/README.md +175 -0
- package/build-style.js +58 -0
- package/dist/dpzvc3.esm.js +17676 -0
- package/dist/dpzvc3.esm.js.map +1 -0
- package/dist/dpzvc3.esm.min.js +2 -0
- package/dist/dpzvc3.esm.min.js.map +1 -0
- package/dist/dpzvc3.js +15200 -0
- package/dist/dpzvc3.js.map +1 -0
- package/dist/dpzvc3.min.js +2 -0
- package/dist/dpzvc3.min.js.map +1 -0
- package/dist/styles/base/font.css +1 -0
- package/dist/styles/base/reset.css +1 -0
- package/dist/styles/base/variable.css +0 -0
- package/dist/styles/components/actionSheet.css +1 -0
- package/dist/styles/components/badge.css +1 -0
- package/dist/styles/components/button.css +1 -0
- package/dist/styles/components/card.css +1 -0
- package/dist/styles/components/cell-swipe.css +1 -0
- package/dist/styles/components/cell.css +1 -0
- package/dist/styles/components/checkBox.css +1 -0
- package/dist/styles/components/editor.css +1 -0
- package/dist/styles/components/header.css +1 -0
- package/dist/styles/components/indicator.css +1 -0
- package/dist/styles/components/loadmore.css +1 -0
- package/dist/styles/components/message.css +1 -0
- package/dist/styles/components/modal.css +1 -0
- package/dist/styles/components/number.css +1 -0
- package/dist/styles/components/picker.css +1 -0
- package/dist/styles/components/popup.css +1 -0
- package/dist/styles/components/progress.css +1 -0
- package/dist/styles/components/prompt.css +1 -0
- package/dist/styles/components/radioBox.css +1 -0
- package/dist/styles/components/slide-Bar.css +1 -0
- package/dist/styles/components/spinner.css +1 -0
- package/dist/styles/components/swipe.css +1 -0
- package/dist/styles/components/switchBar.css +1 -0
- package/dist/styles/components/tab.css +1 -0
- package/dist/styles/components/text.css +1 -0
- package/dist/styles/components/toTop.css +1 -0
- package/dist/styles/components/upload.css +1 -0
- package/dist/styles/dpzvc3.css +1 -0
- package/dist/styles/utils/1px.css +1 -0
- package/dist/styles/utils/animation.css +1 -0
- package/dist/styles/utils/nowrap.css +1 -0
- package/dist-prod/91.9d79b442ec3131707419.js +3 -0
- package/dist-prod/91.9d79b442ec3131707419.js.LICENSE.txt +25 -0
- package/dist-prod/91.9d79b442ec3131707419.js.map +1 -0
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +2 -0
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +1 -0
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +2 -0
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +1 -0
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js +2 -0
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +1 -0
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js +2 -0
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +1 -0
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +2 -0
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +1 -0
- package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js +2 -0
- package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js.map +1 -0
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +2 -0
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +1 -0
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +2 -0
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +1 -0
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +2 -0
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +1 -0
- package/dist-prod/index.html +19 -0
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +2 -0
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +1 -0
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +2 -0
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +1 -0
- package/dist-prod/main.2e9aaa9095e329ea2d7b.js +2 -0
- package/dist-prod/main.2e9aaa9095e329ea2d7b.js.map +1 -0
- package/dist-prod/message.e57fa263a214006f7191.chunk.js +2 -0
- package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +1 -0
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +2 -0
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +1 -0
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +2 -0
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +1 -0
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +2 -0
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +1 -0
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +2 -0
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +1 -0
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +2 -0
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +1 -0
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +2 -0
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +1 -0
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +2 -0
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +1 -0
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +2 -0
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +1 -0
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +2 -0
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +1 -0
- package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js +2 -0
- package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js.map +1 -0
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +2 -0
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +1 -0
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +2 -0
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +1 -0
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +2 -0
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +1 -0
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +2 -0
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +1 -0
- package/dist-prod/upload.ec7a954970889869d93e.chunk.js +2 -0
- package/dist-prod/upload.ec7a954970889869d93e.chunk.js.map +1 -0
- package/images/IMG_2614 2 2.JPG +0 -0
- package/images/IMG_2614.JPG +0 -0
- package/images/IMG_2615 2.JPG +0 -0
- package/images/IMG_2615.JPG +0 -0
- package/package.json +113 -0
- package/postcss.config.js +5 -0
- package/src/components/Indicator/Indicator.vue +82 -0
- package/src/components/Indicator/index.js +86 -0
- package/src/components/Text/Number.vue +167 -0
- package/src/components/Text/index.js +7 -0
- package/src/components/Text/textBar.vue +122 -0
- package/src/components/action-sheet/actionSheet.vue +93 -0
- package/src/components/action-sheet/index.js +5 -0
- package/src/components/app.vue +61 -0
- package/src/components/badge/badge.vue +80 -0
- package/src/components/badge/index.js +5 -0
- package/src/components/button/button.vue +111 -0
- package/src/components/button/index.js +5 -0
- package/src/components/card/card.vue +49 -0
- package/src/components/card/index.js +5 -0
- package/src/components/cell/cell.vue +93 -0
- package/src/components/cell/index.js +5 -0
- package/src/components/cell-swipe/cell-swipe.vue +169 -0
- package/src/components/cell-swipe/index.js +5 -0
- package/src/components/checkBox/checkbox-group.vue +74 -0
- package/src/components/checkBox/checkbox.vue +117 -0
- package/src/components/checkBox/index.js +8 -0
- package/src/components/header/header.vue +130 -0
- package/src/components/header/index.js +5 -0
- package/src/components/loadMore/index.js +5 -0
- package/src/components/loadMore/loadmore.vue +258 -0
- package/src/components/message/confirm.js +60 -0
- package/src/components/message/index.js +111 -0
- package/src/components/message/message.vue +137 -0
- package/src/components/message/messageGroup.vue +82 -0
- package/src/components/modal/confirm.js +122 -0
- package/src/components/modal/index.js +52 -0
- package/src/components/modal/modal.vue +138 -0
- package/src/components/picker/area-picker/area-picker.vue +230 -0
- package/src/components/picker/area-picker/props.js +17 -0
- package/src/components/picker/date-picker/date-picker.vue +191 -0
- package/src/components/picker/date-picker/props.js +24 -0
- package/src/components/picker/index.js +5 -0
- package/src/components/picker/normal-picker/normal-picker.vue +120 -0
- package/src/components/picker/normal-picker/props.js +20 -0
- package/src/components/picker/picker-slot.vue +217 -0
- package/src/components/picker/picker.vue +111 -0
- package/src/components/popup/index.js +5 -0
- package/src/components/popup/popup.vue +91 -0
- package/src/components/progress/index.js +5 -0
- package/src/components/progress/progress.vue +86 -0
- package/src/components/prompt/confirm.js +91 -0
- package/src/components/prompt/index.js +53 -0
- package/src/components/prompt/prompt.vue +125 -0
- package/src/components/radioBox/index.js +8 -0
- package/src/components/radioBox/radiobox-group.vue +66 -0
- package/src/components/radioBox/radiobox.vue +88 -0
- package/src/components/rater/index.js +5 -0
- package/src/components/rater/rater.vue +118 -0
- package/src/components/slideBar/index.js +6 -0
- package/src/components/slideBar/slideBar.vue +207 -0
- package/src/components/spinner/behavior/blade.vue +42 -0
- package/src/components/spinner/behavior/double-bounce.vue +38 -0
- package/src/components/spinner/behavior/fading-circle.vue +55 -0
- package/src/components/spinner/behavior/snake.vue +41 -0
- package/src/components/spinner/behavior/triple-bounce.vue +52 -0
- package/src/components/spinner/index.js +5 -0
- package/src/components/spinner/props.js +28 -0
- package/src/components/spinner/spinner.vue +78 -0
- package/src/components/swipe/index.js +5 -0
- package/src/components/swipe/swipe.vue +281 -0
- package/src/components/switchbar/index.js +5 -0
- package/src/components/switchbar/switchbar.vue +79 -0
- package/src/components/tab/index.js +6 -0
- package/src/components/tab/tab.vue +89 -0
- package/src/components/toTop/index.js +5 -0
- package/src/components/toTop/topTop.vue +78 -0
- package/src/components/upload/index.js +5 -0
- package/src/components/upload/upload.vue +166 -0
- package/src/config/config.js +16 -0
- package/src/directives/clickoutside.js +42 -0
- package/src/directives/tranferDom.js +66 -0
- package/src/index.js +149 -0
- package/src/lib/MegaPixImage.js +163 -0
- package/src/lib/MegaPixImageOld.js +153 -0
- package/src/lib/exif-js.js +235 -0
- package/src/lib/exif.js +789 -0
- package/src/main.js +31 -0
- package/src/mixin/emitter.js +72 -0
- package/src/mixin/input.js +41 -0
- package/src/router.js +36 -0
- package/src/styles/base/font.less +99 -0
- package/src/styles/base/reset.less +135 -0
- package/src/styles/base/variable.less +108 -0
- package/src/styles/components/actionSheet.less +43 -0
- package/src/styles/components/badge.less +81 -0
- package/src/styles/components/button.less +124 -0
- package/src/styles/components/card.less +31 -0
- package/src/styles/components/cell-swipe.less +20 -0
- package/src/styles/components/cell.less +75 -0
- package/src/styles/components/checkBox.less +113 -0
- package/src/styles/components/editor.less +3 -0
- package/src/styles/components/header.less +72 -0
- package/src/styles/components/indicator.less +39 -0
- package/src/styles/components/loadmore.less +48 -0
- package/src/styles/components/message.less +57 -0
- package/src/styles/components/modal.less +84 -0
- package/src/styles/components/number.less +60 -0
- package/src/styles/components/picker.less +152 -0
- package/src/styles/components/popup.less +46 -0
- package/src/styles/components/progress.less +52 -0
- package/src/styles/components/prompt.less +37 -0
- package/src/styles/components/radioBox.less +138 -0
- package/src/styles/components/slide-Bar.less +149 -0
- package/src/styles/components/spinner.less +329 -0
- package/src/styles/components/swipe.less +125 -0
- package/src/styles/components/switchBar.less +88 -0
- package/src/styles/components/tab.less +71 -0
- package/src/styles/components/text.less +82 -0
- package/src/styles/components/toTop.less +28 -0
- package/src/styles/components/upload.less +23 -0
- package/src/styles/index.less +38 -0
- package/src/styles/utils/1px.less +206 -0
- package/src/styles/utils/animation.less +165 -0
- package/src/styles/utils/nowrap.less +19 -0
- package/src/template/index.ejs +40 -0
- package/src/utils/util.js +202 -0
- package/src/vconsole-resources.min.js +6 -0
- package/src/vconsole-sources.min.js +6 -0
- package/src/vconsole.min.js +7 -0
- package/src/views/ActionSheet.vue +46 -0
- package/src/views/Badge.vue +51 -0
- package/src/views/Button.vue +69 -0
- package/src/views/Card.vue +88 -0
- package/src/views/Cell.vue +30 -0
- package/src/views/CellSwipe.vue +68 -0
- package/src/views/CheckBox.vue +77 -0
- package/src/views/Header.vue +70 -0
- package/src/views/Indicator.vue +82 -0
- package/src/views/LoadMore.vue +73 -0
- package/src/views/Message.vue +61 -0
- package/src/views/Modal.vue +69 -0
- package/src/views/Picker.vue +140 -0
- package/src/views/Popup.vue +97 -0
- package/src/views/Progress.vue +47 -0
- package/src/views/Prompt.vue +43 -0
- package/src/views/RadioBox.vue +68 -0
- package/src/views/Rater.vue +49 -0
- package/src/views/SlideBar.vue +55 -0
- package/src/views/Spinner.vue +15 -0
- package/src/views/Swipe.vue +59 -0
- package/src/views/SwitchBar.vue +47 -0
- package/src/views/Tab.vue +53 -0
- package/src/views/Text.vue +93 -0
- package/src/views/ToTop.vue +17 -0
- package/src/views/Upload.vue +61 -0
- package/src/views/guide.vue +164 -0
- package/src/views/index.vue +554 -0
- package/webpack.base.config.js +65 -0
- package/webpack.dev.config.js +42 -0
- package/webpack.dist.dev.config.js +75 -0
- package/webpack.dist.prod.config.js +89 -0
- package/webpack.prod.config.js +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2025 Taki
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# dpzvc3-ui
|
|
2
|
+
|
|
3
|
+
## 一、说明
|
|
4
|
+
|
|
5
|
+
> 一套基于 **Vue 3.X** 的h5移动端通用组件库,提供丰富 UI 组件,兼容最新Vue3.x Cli项目(可以在Vue3.x Cli项目直接引用组件并使用)使用最新的Webpack5构建,并支持 组件以及CSS样式**全量引入** 和 **按需引入**,同时提供公共样式、基础工具样式和服务组件方法(如 Message、Modal、Indicator)。会一直不断完善体验,使用过程有问题欢迎在https://github.com/yishide/dpzvc3/issues提交bug,看到了会及时修复!!!
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 二、组件库预览地址(查看各个组件库的使用效果)
|
|
10
|
+
```bash
|
|
11
|
+
https://yishide.github.io/dpzvc3/#/guide
|
|
12
|
+
```
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 三、安装
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install dpzvc3-ui
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## 四、全量使用
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
全量引入组件库,包括 JS 组件和全量 CSS 样式(适合小型项目或快速开发)。
|
|
28
|
+
|
|
29
|
+
1. 引入组件库 JS
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
import { createApp } from 'vue'
|
|
33
|
+
import App from './components/app.vue'
|
|
34
|
+
import dpzvc3 from 'dpzvc3-ui'
|
|
35
|
+
|
|
36
|
+
// 1️⃣ 创建 app
|
|
37
|
+
const app = createApp(App)
|
|
38
|
+
|
|
39
|
+
// 2️⃣ 安装你的组件库
|
|
40
|
+
app.use(dpzvc3)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. 引入全量样式
|
|
44
|
+
|
|
45
|
+
/* 在入口文件或全局样式中引入 */
|
|
46
|
+
```bash
|
|
47
|
+
@import "~dpzvc3-ui/dist/styles/dpzvc3.css";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
此方式会包含 components、base、utils 下的全部样式。
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 五、按需使用
|
|
54
|
+
|
|
55
|
+
按需引入可以减小打包体积,只引入你需要的组件及样式。
|
|
56
|
+
|
|
57
|
+
1. 引入组件
|
|
58
|
+
```bash
|
|
59
|
+
import { createApp } from 'vue'
|
|
60
|
+
import App from './components/app.vue'
|
|
61
|
+
import { VButton, Badge } from 'dpzvc3-ui'
|
|
62
|
+
|
|
63
|
+
// 1️⃣ 创建 app
|
|
64
|
+
const app = createApp(App)
|
|
65
|
+
|
|
66
|
+
// 2️⃣ 安装你的组件库
|
|
67
|
+
app.use(VButton)
|
|
68
|
+
app.use(Badge)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
2. 引入组件 CSS
|
|
72
|
+
```bash
|
|
73
|
+
@import "~dpzvc3-ui/dist/styles/components/button.css";
|
|
74
|
+
@import "~dpzvc3-ui/dist/styles/components/badge.css";
|
|
75
|
+
```
|
|
76
|
+
3. 公共样式按需引入(可选)建议全部加上
|
|
77
|
+
```bash
|
|
78
|
+
@import "~dpzvc3-ui/dist/styles/base/font.css";
|
|
79
|
+
@import "~dpzvc3-ui/dist/styles/base/variable.css";
|
|
80
|
+
@import "~dpzvc3-ui/dist/styles/base/reset.css";
|
|
81
|
+
@import "~dpzvc3-ui/dist/styles/utils/1px.css";
|
|
82
|
+
@import "~dpzvc3-ui/dist/styles/utils/animation.css";
|
|
83
|
+
@import "~dpzvc3-ui/dist/styles/utils/nowrap.css";
|
|
84
|
+
```
|
|
85
|
+
注意:按需引入组件时,如果组件依赖变量或 mixin,需要保证 base / utils 样式已引入。
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 六、服务组件使用
|
|
90
|
+
|
|
91
|
+
dpzvc3-ui 提供一些 服务组件,无需注册即可使用,如:
|
|
92
|
+
• Message
|
|
93
|
+
• Modal
|
|
94
|
+
• Prompt
|
|
95
|
+
• Indicator
|
|
96
|
+
|
|
97
|
+
使用示例
|
|
98
|
+
```bash
|
|
99
|
+
import Vue from 'vue'
|
|
100
|
+
import dpzvc3 from 'dpzvc3-ui'
|
|
101
|
+
import { Message, Modal, Prompt, Indicator } from 'dpzvc3-ui'
|
|
102
|
+
Vue.use(Message)
|
|
103
|
+
Vue.use(Modal)
|
|
104
|
+
Vue.use(Prompt)
|
|
105
|
+
Vue.use(Indicator)
|
|
106
|
+
|
|
107
|
+
import { createApp } from 'vue'
|
|
108
|
+
import App from './components/app.vue'
|
|
109
|
+
import { Message, Modal, Prompt, Indicator } from 'dpzvc3-ui'
|
|
110
|
+
|
|
111
|
+
// 1️⃣ 创建 app
|
|
112
|
+
const app = createApp(App)
|
|
113
|
+
|
|
114
|
+
// 2️⃣ 安装你的组件库
|
|
115
|
+
app.use(Message)
|
|
116
|
+
app.use(Modal)
|
|
117
|
+
app.use(Prompt)
|
|
118
|
+
app.use(Indicator)
|
|
119
|
+
|
|
120
|
+
// 直接使用服务组件 this指向Vue实例
|
|
121
|
+
需要拿到vue实例
|
|
122
|
+
import { getCurrentInstance } from 'vue'
|
|
123
|
+
const { proxy } = getCurrentInstance() // 用于访问全局 当前vue组件实例
|
|
124
|
+
proxy.$Message.show('操作成功!')
|
|
125
|
+
proxy.$Modal.confirm({body:'这是内容',onOk:function(){})
|
|
126
|
+
proxy.$Prompt.info({title:'Prompt',spec:'ccc',text:'vvvv'})
|
|
127
|
+
proxy.$Indicator.blade()
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 七、目录结构(dist 打包示例)
|
|
134
|
+
```bash
|
|
135
|
+
dist/
|
|
136
|
+
└── styles/
|
|
137
|
+
├── dpzvc3.css # 全量 CSS
|
|
138
|
+
├── components/
|
|
139
|
+
│ ├── button.css
|
|
140
|
+
│ ├── badge.css
|
|
141
|
+
│ └── ...
|
|
142
|
+
├── base/
|
|
143
|
+
│ ├── reset.css
|
|
144
|
+
│ ├── variables.css
|
|
145
|
+
│ └── ...
|
|
146
|
+
└── utils/
|
|
147
|
+
├── mixins.css
|
|
148
|
+
└── ...
|
|
149
|
+
```
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 八、开发和调试
|
|
153
|
+
开发组件请放在 src/components
|
|
154
|
+
• 公共变量、样式放在 src/styles/base
|
|
155
|
+
• 工具 mixin 放在 src/styles/utils
|
|
156
|
+
• 组件样式放在 src/styles/components
|
|
157
|
+
• Gulp 任务已支持按需打包和全量打包
|
|
158
|
+
---
|
|
159
|
+
## 九、注意事项
|
|
160
|
+
|
|
161
|
+
1. 按需引入组件时,请确保 依赖的 base / utils 样式 已引入,否则可能出现变量未定义的错误。
|
|
162
|
+
2. 服务组件如 Message、Modal 等无需单独注册,全局可直接使用。
|
|
163
|
+
3. 全量引入适合快速开发,但会增加打包体积;按需引入可减小体积,推荐生产环境使用。
|
|
164
|
+
|
|
165
|
+
⸻
|
|
166
|
+
|
|
167
|
+
现在可以开始在项目中愉快地使用 dpzvc3-ui 组件库了 🎉
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 十、我要支持作者
|
|
171
|
+
如果该项目组件库帮到了您,节省了您宝贵的开发时间,还请您不吝给项目点个免费的赞。
|
|
172
|
+
当然了,如果您能请作者喝杯咖啡,哪怕喝瓶娃娃哈矿泉水,也是对作者最真诚的鼓励,
|
|
173
|
+

|
|
174
|
+

|
|
175
|
+
|
package/build-style.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const gulp = require('gulp');
|
|
2
|
+
const less = require('gulp-less');
|
|
3
|
+
const cleanCSS = require('gulp-clean-css');
|
|
4
|
+
const rename = require('gulp-rename');
|
|
5
|
+
const postcss = require('gulp-postcss');
|
|
6
|
+
const autoprefixer = require('autoprefixer');
|
|
7
|
+
const { deleteAsync } = require('del'); // 新增
|
|
8
|
+
|
|
9
|
+
// 清空 dist 目录
|
|
10
|
+
function clean() {
|
|
11
|
+
return deleteAsync(['./dist/**', '!./dist']); // 删除 dist 下所有文件和子目录,但保留 dist 目录本身
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// 打包组件 CSS
|
|
15
|
+
function componentsCSS() {
|
|
16
|
+
return gulp.src('./src/styles/components/*.less')
|
|
17
|
+
.pipe(less())
|
|
18
|
+
.pipe(postcss([autoprefixer()]))
|
|
19
|
+
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
|
20
|
+
.pipe(rename({ dirname: '', extname: '.css' }))
|
|
21
|
+
.pipe(gulp.dest('./dist/styles/components'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 打包 base CSS
|
|
25
|
+
function baseCSS() {
|
|
26
|
+
return gulp.src('./src/styles/base/*.less')
|
|
27
|
+
.pipe(less())
|
|
28
|
+
.pipe(postcss([autoprefixer()]))
|
|
29
|
+
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
|
30
|
+
.pipe(rename({ dirname: '', extname: '.css' }))
|
|
31
|
+
.pipe(gulp.dest('./dist/styles/base'));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 打包 utils CSS
|
|
35
|
+
function utilsCSS() {
|
|
36
|
+
return gulp.src('./src/styles/utils/*.less')
|
|
37
|
+
.pipe(less())
|
|
38
|
+
.pipe(postcss([autoprefixer()]))
|
|
39
|
+
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
|
40
|
+
.pipe(rename({ dirname: '', extname: '.css' }))
|
|
41
|
+
.pipe(gulp.dest('./dist/styles/utils'));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 打包全局 index.less
|
|
45
|
+
function globalCSS() {
|
|
46
|
+
return gulp.src('./src/styles/index.less')
|
|
47
|
+
.pipe(less())
|
|
48
|
+
.pipe(postcss([autoprefixer()]))
|
|
49
|
+
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
|
50
|
+
.pipe(rename('dpzvc3.css'))
|
|
51
|
+
.pipe(gulp.dest('./dist/styles'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 默认任务:先清空 dist,再并行打包所有 CSS
|
|
55
|
+
exports.default = gulp.series(
|
|
56
|
+
clean,
|
|
57
|
+
gulp.parallel(globalCSS, componentsCSS, baseCSS, utilsCSS)
|
|
58
|
+
);
|