Skip to content

Commit

Permalink
添加可控制默认单位的unit参数配置
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Dec 13, 2021
1 parent cba77be commit a804eee
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Vue.prototype.$store = store
Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)

Vue.use(uView)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Expand Down
17 changes: 17 additions & 0 deletions uni_modules/uview-ui/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 2.0.11(2021-12-13)
## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY)

# uView2.0重磅发布,利剑出鞘,一统江湖

1. text组件align参数无效的问题
2. subsection组件添加keyName参数
3. upload组件无法判断[Object file]类型的问题
4. 处理notify层级过低问题
5. codeInput组件添加disabledDot参数
6. 处理actionSheet组件round参数无效的问题
7. calendar组件添加round参数用于控制圆角值
8. 处理swipeAction组件在vue环境下默认被打开的问题
9. button组件的throttleTime节流参数无效的问题
10. 解决u-notify手动关闭方法close()无效的问题
11. input组件readonly不生效问题
12. tag组件type参数为info不生效问题
## 2.0.10(2021-12-08)
## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY)

Expand Down
8 changes: 5 additions & 3 deletions uni_modules/uview-ui/libs/config/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 此版本发布于2020-12-08
const version = '2.0.10'
// 此版本发布于2020-12-13
const version = '2.0.11'

export default {
v: version,
Expand All @@ -23,5 +23,7 @@ export default {
'u-content-color': '#606266',
'u-tips-color': '#909399',
'u-light-color': '#c0c4cc'
}
},
// 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
unit: 'px'
}
2 changes: 1 addition & 1 deletion uni_modules/uview-ui/libs/function/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function addStyle(customStyle, target = 'object') {
}

// 添加单位,如果有rpx,upx,%,px等单位结尾或者值为auto,直接返回,否则加上px单位结尾
function addUnit(value = 'auto', unit = 'px') {
function addUnit(value = 'auto', unit = uni?.$u?.config?.unit ?? 'px') {
value = String(value)
// 用uView内置验证规则中的number判断是否为数值
return test.number(value) ? `${value}${unit}` : value
Expand Down
2 changes: 1 addition & 1 deletion uni_modules/uview-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "uview-ui",
"name": "uview-ui",
"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
"version": "2.0.10",
"version": "2.0.11",
"description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"keywords": [
"uview",
Expand Down

0 comments on commit a804eee

Please sign in to comment.