py-uni
v0.0.66
Published
py-uni
Readme
py-uni文档
安装
# npm方式安装
npm i py-uni快速上手
1.main.js引入Py-uni库
// main.js
import pyUni from 'py-uni';
Vue.use(pyUni);备注: sass-loader 为 8.0.2版本
2.pages.json配置easycom规则(按需引入)
// 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": [
// ......
]
}- 在
uni.scss中引入样式
@import "~py-uni/py-uni";- 在
src下建立config文件,建立以下文件

footer.config.json文件配置如下:

request.config.json文件配置如下:

使用方法
配置easycom规则后,自动按需引入,无需import组件,直接引用即可。
<template>
<py-footer></py-footer>
</template>版本说明
- 使用this.$service调通服务
- 使用this.$py调用方法
更新记录
2020/7/28
1.$py中新增
去除空格方法:trim()
对象深度拷贝: deepMerge()
对象和数组的深度克隆: deepClone()
校验数据规则: check()
新增跳转方法:onLinkTo() 传递2个参数 path和type(默认navigateTo跳转)