UNPKG

py-uni

Version:

py-uni

81 lines (61 loc) 1.57 kB
# py-uni文档 ## 安装 ```bash # npm方式安装 npm i py-uni ``` ## 快速上手 1.`main.js`引入Py-uni库 ```js // main.js import pyUni from 'py-uni'; Vue.use(pyUni); ``` ## 备注: sass-loader 为 8.0.2版本 2.`pages.json`配置easycom规则(按需引入) ```js // pages.json { "easycom": { "^py-(.*)": "py-uni/components/py-$1/py-$1.vue", "^u-(.*)": "py-uni/libs/nodeModele/uview-ui/components/u-$1/u-$1.vue" }, // 此为本身已有的内容 "pages": [ // ...... ] } ``` 3. 在`uni.scss`中引入样式 ``` @import "~py-uni/py-uni"; ``` 4. 在`src`下建立`config文件`,建立以下文件 ![](static/config.png) ``footer.config.json``文件配置如下: ![](static/footer.config.png) ``request.config.json``文件配置如下: ![](static/request.png) ## 使用方法 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 ```html <template> <py-footer></py-footer> </template> ``` ## 版本说明 * 使用this.$service调通服务 * 使用this.$py调用方法 ## 更新记录 ### 2020/7/28 #### 1.$py中新增 ```` 去除空格方法:trim() 对象深度拷贝: deepMerge() 对象和数组的深度克隆: deepClone() 校验数据规则: check() 新增跳转方法:onLinkTo() 传递2个参数 path和type(默认navigateTo跳转) ```` #### 2.classStyle.scss新增display样式,border样式 ### 2020/7/29 #### 1.新增py-search组件 通过py-search调用,无需引用路径