sadais-piui 1.2.7-beta8 → 1.2.7-beta80
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/CHANGELOG.md +545 -545
- package/LICENSE +20 -20
- package/README.md +166 -166
- package/components/pi-action-sheet/index.vue +247 -247
- package/components/pi-badge/index.vue +136 -136
- package/components/pi-bottom-bar/index.vue +139 -139
- package/components/pi-bubble/index.vue +174 -174
- package/components/pi-button/index.vue +492 -492
- package/components/pi-calendar/index.vue +187 -182
- package/components/pi-calendar-input/index.vue +215 -199
- package/components/pi-calendar-panel/components/calendar-days/index.vue +410 -371
- package/components/pi-calendar-panel/index.vue +473 -457
- package/components/pi-canvas/index.vue +400 -400
- package/components/pi-card/index.vue +127 -127
- package/components/pi-cascader/index.vue +555 -0
- package/components/pi-checkbox/index.vue +363 -364
- package/components/pi-checkbox-group/index.vue +215 -221
- package/components/pi-circle-progress/index.vue +311 -224
- package/components/pi-code-input/index.vue +262 -262
- package/components/pi-collapse/index.vue +124 -0
- package/components/pi-collapse-item/index.vue +352 -0
- package/components/pi-count-down/index.vue +245 -245
- package/components/pi-count-up/index.vue +209 -209
- package/components/pi-date-picker/index.vue +464 -391
- package/components/pi-date-picker-input/index.vue +204 -188
- package/components/pi-divider/index.vue +112 -112
- package/components/pi-dropdown/components/dropdown-tab.vue +71 -62
- package/components/pi-dropdown/index.vue +352 -336
- package/components/pi-dropdown-item/index.vue +252 -240
- package/components/pi-form/index.vue +273 -273
- package/components/pi-form-item/index.vue +590 -585
- package/components/pi-gap/index.vue +72 -72
- package/components/pi-grid/index.vue +92 -92
- package/components/pi-grid-item/index.vue +220 -220
- package/components/pi-icon/index.vue +147 -147
- package/components/pi-img/index.vue +266 -267
- package/components/pi-img-cropper/canvas.js +106 -106
- package/components/pi-img-cropper/index.vue +357 -357
- package/components/pi-img-cropper/touch.js +163 -163
- package/components/pi-img-cropper/vector.js +34 -34
- package/components/pi-input/index.vue +395 -348
- package/components/pi-line/index.vue +78 -78
- package/components/pi-line-progress/index.vue +198 -198
- package/components/pi-list/index.vue +115 -115
- package/components/pi-list-item/index.vue +335 -335
- package/components/pi-loading/index.vue +188 -188
- package/components/pi-marquee/index.vue +310 -310
- package/components/pi-marquee-item/index.vue +47 -47
- package/components/pi-mask/index.vue +198 -198
- package/components/pi-modal/index.vue +303 -303
- package/components/pi-navbar/index.vue +421 -421
- package/components/pi-notify/index.vue +239 -239
- package/components/pi-number-keyboard/index.vue +189 -189
- package/components/pi-opentype-button/index.vue +501 -501
- package/components/pi-pagination/index.vue +277 -277
- package/components/pi-picker/index.vue +317 -317
- package/components/pi-popup/index.vue +357 -353
- package/components/pi-popup-select/index.vue +293 -293
- package/components/pi-radio/index.vue +406 -406
- package/components/pi-radio-group/index.vue +276 -280
- package/components/pi-rate/index.vue +212 -212
- package/components/pi-regions-select/index.vue +349 -344
- package/components/pi-regions-select-input/index.vue +203 -192
- package/components/pi-search/index.vue +378 -351
- package/components/pi-section/index.vue +218 -218
- package/components/pi-select/index.vue +507 -463
- package/components/pi-select-input/index.vue +224 -208
- package/components/pi-skeleton/index.vue +280 -280
- package/components/pi-status-bar/index.vue +56 -56
- package/components/pi-stepper/index.vue +394 -394
- package/components/pi-steps/index.vue +378 -299
- package/components/pi-subsection/index.vue +403 -403
- package/components/pi-swiper/index.vue +344 -344
- package/components/pi-switch/index.vue +227 -227
- package/components/pi-table/index.vue +351 -0
- package/components/pi-tabs/index.vue +405 -399
- package/components/pi-tag/index.vue +488 -0
- package/components/pi-upload-img/index.vue +561 -512
- package/components/pi-waterfall/index.vue +130 -130
- package/components/pi-webview/index.vue +92 -82
- package/config/actionSheet.js +24 -25
- package/config/badge.js +9 -9
- package/config/bottomBar.js +11 -11
- package/config/bubble.js +6 -6
- package/config/button.js +29 -29
- package/config/calendar.js +19 -19
- package/config/calendarInput.js +18 -18
- package/config/calendarPanel.js +27 -26
- package/config/card.js +8 -8
- package/config/cascader.js +22 -0
- package/config/checkbox.js +15 -15
- package/config/checkboxGroup.js +15 -15
- package/config/circleProgress.js +20 -13
- package/config/codeInput.js +12 -12
- package/config/collapse.js +7 -0
- package/config/collapseItem.js +11 -0
- package/config/countDown.js +12 -12
- package/config/countUp.js +13 -13
- package/config/datePicker.js +29 -24
- package/config/datePickerInput.js +17 -17
- package/config/divider.js +10 -10
- package/config/dropdown.js +24 -23
- package/config/dropdownItem.js +26 -26
- package/config/form.js +29 -29
- package/config/formItem.js +27 -27
- package/config/gap.js +8 -8
- package/config/grid.js +9 -9
- package/config/gridItem.js +12 -12
- package/config/icon.js +11 -11
- package/config/img.js +21 -21
- package/config/imgCropper.js +26 -26
- package/config/index.js +28 -28
- package/config/input.js +36 -35
- package/config/line.js +8 -8
- package/config/lineProgress.js +14 -14
- package/config/list.js +12 -12
- package/config/listItem.js +25 -25
- package/config/loading.js +10 -10
- package/config/marquee.js +10 -10
- package/config/mask.js +12 -12
- package/config/modal.js +36 -36
- package/config/navbar.js +32 -32
- package/config/notify.js +13 -13
- package/config/numberKeyboard.js +21 -21
- package/config/pagination.js +10 -10
- package/config/picker.js +19 -19
- package/config/popup.js +23 -23
- package/config/popupSelect.js +35 -35
- package/config/radio.js +16 -16
- package/config/radioGroup.js +17 -17
- package/config/rate.js +15 -15
- package/config/regionsData.js +58 -58
- package/config/regionsSelect.js +19 -19
- package/config/regionsSelectInput.js +28 -28
- package/config/search.js +27 -27
- package/config/section.js +23 -23
- package/config/select.js +31 -29
- package/config/selectInput.js +28 -28
- package/config/skeleton.js +13 -13
- package/config/statusBar.js +5 -5
- package/config/stepper.js +19 -19
- package/config/steps.js +19 -19
- package/config/subsection.js +14 -14
- package/config/swiper.js +22 -22
- package/config/switch.js +13 -13
- package/config/table.js +9 -0
- package/config/tabs.js +23 -23
- package/config/tag.js +21 -0
- package/config/uploadImg.js +59 -63
- package/config/waterfall.js +6 -6
- package/index.js +41 -41
- package/mixin/component-custom.js +24 -24
- package/mixin/emitter.js +45 -45
- package/mixin/props-sync.js +65 -65
- package/mixin/value-sync.js +32 -32
- package/mixin/wx-code.js +30 -30
- package/package.json +28 -25
- package/plugins/async-validator.js +1511 -1511
- package/scss/animation.scss +260 -260
- package/scss/common.scss +11 -13
- package/scss/icon/icon.scss +595 -594
- package/scss/index.scss +5 -5
- package/scss/mixin.scss +47 -47
- package/tools/index.js +19 -19
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 www.uviewui.com
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 www.uviewui.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
# PiUI
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
[](https://github.com/sadais-org/piui)
|
|
5
|
-
[](https://github.com/sadais-org/piui)
|
|
6
|
-
[](https://github.com/sadais-org/piui/issues)
|
|
7
|
-
[](https://gitee.com/xuqu/uView/releases)
|
|
8
|
-
[](https://en.wikipedia.org/wiki/MIT_License)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
PiUI是基于uniapp,高质量UI移动组件库,基于 `vue.js` 语法,可编译到不同的平台
|
|
12
|
-
|
|
13
|
-
* 高效开发
|
|
14
|
-
* 灵活扩展,丰富的属性配置
|
|
15
|
-
* 提供 50+ 高质量组件,覆盖移动端各类场景
|
|
16
|
-
* 高性能
|
|
17
|
-
* 完善的文档和示例
|
|
18
|
-
* 按需引入
|
|
19
|
-
* 支持主题定制
|
|
20
|
-
|
|
21
|
-
## Website 网站
|
|
22
|
-
|
|
23
|
-
[官方文档:https://piui.sadais.com/](https://piui.sadais.com/)
|
|
24
|
-
|
|
25
|
-
[GITHUB仓库:https://github.com/sadais-org/piui](https://github.com/sadais-org/piui)
|
|
26
|
-
|
|
27
|
-
[GITEE仓库:https://gitee.com/org-sadais/piui](https://gitee.com/org-sadais/piui)
|
|
28
|
-
|
|
29
|
-
`欢迎大家star和fork,你的支持是我们持续更新的动力!`
|
|
30
|
-
|
|
31
|
-
`扫码体验[piui]小程序`
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
## Background 背景
|
|
36
|
-
|
|
37
|
-
uniapp提供的vue语法(不完全支持),能比原生的写法(小程序原生语法作为对比)提高30%的效率。
|
|
38
|
-
|
|
39
|
-
但是仅仅使用uniapp提供的基础组件,是远远支撑不了现代移动端的业务复杂度。
|
|
40
|
-
|
|
41
|
-
借助`piui`的能力,可以让您基于uniapp,再增加至少50%的效率提升。
|
|
42
|
-
|
|
43
|
-
## Install 安装
|
|
44
|
-
|
|
45
|
-
### 使用脚手架【推荐】
|
|
46
|
-
基于`vue-cli`脚手架创建,更加通用的`vue`项目配置,接入更加快捷,可以做到零配置直接运行,其中引入了`sadais-core`
|
|
47
|
-
|
|
48
|
-
#### 步骤1: vue-cli安装(如果安装了可以跳过)
|
|
49
|
-
可以使用下列任一命令安装最新的`vue-cli`包:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npm install -g @vue/cli
|
|
54
|
-
# OR
|
|
55
|
-
yarn global add @vue/cli
|
|
56
|
-
```
|
|
57
|
-
安装之后,你就可以在命令行中访问 `vue` 命令。你可以通过简单运行 `vue`,看看是否展示出了一份所有可用命令的帮助信息,来验证它是否安装成功。
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
你还可以用这个命令来检查其版本是否正确:
|
|
61
|
-
```bash
|
|
62
|
-
vue --version
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
#### 步骤2:文件生成
|
|
66
|
-
项目初始化我们通过vue-cli进行生成,以下项目名我使用my-project做示例,名字可以自定义
|
|
67
|
-
```bash
|
|
68
|
-
vue create -p sadais-org/uni-preset-vue my-project
|
|
69
|
-
```
|
|
70
|
-
命令输入后,选择默认模板,回车
|
|
71
|
-
|
|
72
|
-
#### 步骤3:项目启动
|
|
73
|
-
在本地启动服务器来开发你的应用
|
|
74
|
-
```bash
|
|
75
|
-
cd my-project && npm run dev
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 非脚手架项目引入(HbuilderX / Uniapp Vue-Cli工程)
|
|
79
|
-
|
|
80
|
-
> 已初始化的项目,可以通过以下方式接入piui
|
|
81
|
-
|
|
82
|
-
`piui` `@sadais/piui-tool` 源码都以[es6](https://es6.ruanyifeng.com/) 语法编写,如果是 `vue-cli` 工程,必须在`vue.config.js`中声明其[显式转译](https://cli.vuejs.org/zh/config/#transpiledependencies)
|
|
83
|
-
|
|
84
|
-
```js
|
|
85
|
-
// vue.config.js
|
|
86
|
-
module.exports = {
|
|
87
|
-
transpileDependencies: ['@sadais/piui-tool', 'sadais-piui']
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### 步骤1:安装piui
|
|
92
|
-
安装`piui`,以及`piui工具库`
|
|
93
|
-
```bash
|
|
94
|
-
yarn add sadais-piui @sadais/piui-tool
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
#### 步骤2:引入piui
|
|
98
|
-
```js
|
|
99
|
-
import Vue from 'vue';
|
|
100
|
-
import piui from "sadais-piui";
|
|
101
|
-
|
|
102
|
-
// 全局属性配置
|
|
103
|
-
const piuiConfig = {}
|
|
104
|
-
|
|
105
|
-
Vue.use(piui, piuiConfig);
|
|
106
|
-
```
|
|
107
|
-
#### 步骤3:引入piui样式文件
|
|
108
|
-
在App.vue文件中引入
|
|
109
|
-
```css
|
|
110
|
-
@import 'sadais-piui/scss/index.scss';
|
|
111
|
-
```
|
|
112
|
-
在uni.css文件中引入
|
|
113
|
-
```css
|
|
114
|
-
@import 'sadais-piui/scss/variable.scss';
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
#### 步骤4:通过easycom模式全局按需引入
|
|
118
|
-
修改uniapp的pages.json文件,增加配置
|
|
119
|
-
|
|
120
|
-
```json
|
|
121
|
-
"easycom": {
|
|
122
|
-
"^pi-(.*)": "sadais-piui/components/pi-$1/index.vue"
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Usage 使用方法
|
|
127
|
-
|
|
128
|
-
配置easycom规则后,自动按需引入
|
|
129
|
-
|
|
130
|
-
## Maintainers 成员
|
|
131
|
-
|
|
132
|
-
[@zhangzhenfei](https://github.com/zhangzhenfei)
|
|
133
|
-
|
|
134
|
-
## Contributing 贡献
|
|
135
|
-
|
|
136
|
-
PRs accepted.
|
|
137
|
-
|
|
138
|
-
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
|
|
139
|
-
|
|
140
|
-
## Issue 规范
|
|
141
|
-
issue 仅用于提交 Bug 或 Feature 相关的内容,其它内容可能会被直接关闭。
|
|
142
|
-
|
|
143
|
-
在提交 issue 之前,请搜索相关内容是否已被提出。
|
|
144
|
-
|
|
145
|
-
请说明 PiUI 和 Vue 的版本号,并提供操作系统和浏览器信息。推荐使用 生成在线 demo,这能够更直观地重现问题。
|
|
146
|
-
|
|
147
|
-
## Pull Request 规范
|
|
148
|
-
请先 fork 一份到自己的项目下,不要直接在仓库下建分支。
|
|
149
|
-
|
|
150
|
-
commit 信息要以[组件名]: 描述信息 的形式填写,例如 [Navbar]: fix xxx bug。
|
|
151
|
-
|
|
152
|
-
执行 npm run build 后可以正确打包文件。
|
|
153
|
-
|
|
154
|
-
提交 PR 前请 rebase,确保 commit 记录的整洁。
|
|
155
|
-
|
|
156
|
-
如果是修复 bug,请在 PR 中给出描述信息。
|
|
157
|
-
|
|
158
|
-
## License
|
|
159
|
-
|
|
160
|
-
MIT © 2021 zhangzhenfei
|
|
161
|
-
|
|
162
|
-
## 微信群
|
|
163
|
-
|
|
164
|
-
请扫码进群
|
|
165
|
-
|
|
166
|
-

|
|
1
|
+
# PiUI
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
[](https://github.com/sadais-org/piui)
|
|
5
|
+
[](https://github.com/sadais-org/piui)
|
|
6
|
+
[](https://github.com/sadais-org/piui/issues)
|
|
7
|
+
[](https://gitee.com/xuqu/uView/releases)
|
|
8
|
+
[](https://en.wikipedia.org/wiki/MIT_License)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
PiUI是基于uniapp,高质量UI移动组件库,基于 `vue.js` 语法,可编译到不同的平台
|
|
12
|
+
|
|
13
|
+
* 高效开发
|
|
14
|
+
* 灵活扩展,丰富的属性配置
|
|
15
|
+
* 提供 50+ 高质量组件,覆盖移动端各类场景
|
|
16
|
+
* 高性能
|
|
17
|
+
* 完善的文档和示例
|
|
18
|
+
* 按需引入
|
|
19
|
+
* 支持主题定制
|
|
20
|
+
|
|
21
|
+
## Website 网站
|
|
22
|
+
|
|
23
|
+
[官方文档:https://piui.sadais.com/](https://piui.sadais.com/)
|
|
24
|
+
|
|
25
|
+
[GITHUB仓库:https://github.com/sadais-org/piui](https://github.com/sadais-org/piui)
|
|
26
|
+
|
|
27
|
+
[GITEE仓库:https://gitee.com/org-sadais/piui](https://gitee.com/org-sadais/piui)
|
|
28
|
+
|
|
29
|
+
`欢迎大家star和fork,你的支持是我们持续更新的动力!`
|
|
30
|
+
|
|
31
|
+
`扫码体验[piui]小程序`
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
## Background 背景
|
|
36
|
+
|
|
37
|
+
uniapp提供的vue语法(不完全支持),能比原生的写法(小程序原生语法作为对比)提高30%的效率。
|
|
38
|
+
|
|
39
|
+
但是仅仅使用uniapp提供的基础组件,是远远支撑不了现代移动端的业务复杂度。
|
|
40
|
+
|
|
41
|
+
借助`piui`的能力,可以让您基于uniapp,再增加至少50%的效率提升。
|
|
42
|
+
|
|
43
|
+
## Install 安装
|
|
44
|
+
|
|
45
|
+
### 使用脚手架【推荐】
|
|
46
|
+
基于`vue-cli`脚手架创建,更加通用的`vue`项目配置,接入更加快捷,可以做到零配置直接运行,其中引入了`sadais-core`
|
|
47
|
+
|
|
48
|
+
#### 步骤1: vue-cli安装(如果安装了可以跳过)
|
|
49
|
+
可以使用下列任一命令安装最新的`vue-cli`包:
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g @vue/cli
|
|
54
|
+
# OR
|
|
55
|
+
yarn global add @vue/cli
|
|
56
|
+
```
|
|
57
|
+
安装之后,你就可以在命令行中访问 `vue` 命令。你可以通过简单运行 `vue`,看看是否展示出了一份所有可用命令的帮助信息,来验证它是否安装成功。
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
你还可以用这个命令来检查其版本是否正确:
|
|
61
|
+
```bash
|
|
62
|
+
vue --version
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 步骤2:文件生成
|
|
66
|
+
项目初始化我们通过vue-cli进行生成,以下项目名我使用my-project做示例,名字可以自定义
|
|
67
|
+
```bash
|
|
68
|
+
vue create -p sadais-org/uni-preset-vue my-project
|
|
69
|
+
```
|
|
70
|
+
命令输入后,选择默认模板,回车
|
|
71
|
+
|
|
72
|
+
#### 步骤3:项目启动
|
|
73
|
+
在本地启动服务器来开发你的应用
|
|
74
|
+
```bash
|
|
75
|
+
cd my-project && npm run dev
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 非脚手架项目引入(HbuilderX / Uniapp Vue-Cli工程)
|
|
79
|
+
|
|
80
|
+
> 已初始化的项目,可以通过以下方式接入piui
|
|
81
|
+
|
|
82
|
+
`piui` `@sadais/piui-tool` 源码都以[es6](https://es6.ruanyifeng.com/) 语法编写,如果是 `vue-cli` 工程,必须在`vue.config.js`中声明其[显式转译](https://cli.vuejs.org/zh/config/#transpiledependencies)
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
// vue.config.js
|
|
86
|
+
module.exports = {
|
|
87
|
+
transpileDependencies: ['@sadais/piui-tool', 'sadais-piui']
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### 步骤1:安装piui
|
|
92
|
+
安装`piui`,以及`piui工具库`
|
|
93
|
+
```bash
|
|
94
|
+
yarn add sadais-piui @sadais/piui-tool
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### 步骤2:引入piui
|
|
98
|
+
```js
|
|
99
|
+
import Vue from 'vue';
|
|
100
|
+
import piui from "sadais-piui";
|
|
101
|
+
|
|
102
|
+
// 全局属性配置
|
|
103
|
+
const piuiConfig = {}
|
|
104
|
+
|
|
105
|
+
Vue.use(piui, piuiConfig);
|
|
106
|
+
```
|
|
107
|
+
#### 步骤3:引入piui样式文件
|
|
108
|
+
在App.vue文件中引入
|
|
109
|
+
```css
|
|
110
|
+
@import 'sadais-piui/scss/index.scss';
|
|
111
|
+
```
|
|
112
|
+
在uni.css文件中引入
|
|
113
|
+
```css
|
|
114
|
+
@import 'sadais-piui/scss/variable.scss';
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### 步骤4:通过easycom模式全局按需引入
|
|
118
|
+
修改uniapp的pages.json文件,增加配置
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
"easycom": {
|
|
122
|
+
"^pi-(.*)": "sadais-piui/components/pi-$1/index.vue"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Usage 使用方法
|
|
127
|
+
|
|
128
|
+
配置easycom规则后,自动按需引入
|
|
129
|
+
|
|
130
|
+
## Maintainers 成员
|
|
131
|
+
|
|
132
|
+
[@zhangzhenfei](https://github.com/zhangzhenfei)
|
|
133
|
+
|
|
134
|
+
## Contributing 贡献
|
|
135
|
+
|
|
136
|
+
PRs accepted.
|
|
137
|
+
|
|
138
|
+
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
|
|
139
|
+
|
|
140
|
+
## Issue 规范
|
|
141
|
+
issue 仅用于提交 Bug 或 Feature 相关的内容,其它内容可能会被直接关闭。
|
|
142
|
+
|
|
143
|
+
在提交 issue 之前,请搜索相关内容是否已被提出。
|
|
144
|
+
|
|
145
|
+
请说明 PiUI 和 Vue 的版本号,并提供操作系统和浏览器信息。推荐使用 生成在线 demo,这能够更直观地重现问题。
|
|
146
|
+
|
|
147
|
+
## Pull Request 规范
|
|
148
|
+
请先 fork 一份到自己的项目下,不要直接在仓库下建分支。
|
|
149
|
+
|
|
150
|
+
commit 信息要以[组件名]: 描述信息 的形式填写,例如 [Navbar]: fix xxx bug。
|
|
151
|
+
|
|
152
|
+
执行 npm run build 后可以正确打包文件。
|
|
153
|
+
|
|
154
|
+
提交 PR 前请 rebase,确保 commit 记录的整洁。
|
|
155
|
+
|
|
156
|
+
如果是修复 bug,请在 PR 中给出描述信息。
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT © 2021 zhangzhenfei
|
|
161
|
+
|
|
162
|
+
## 微信群
|
|
163
|
+
|
|
164
|
+
请扫码进群
|
|
165
|
+
|
|
166
|
+

|