首次提交

This commit is contained in:
duan
2024-06-06 11:49:50 +08:00
parent de480ef0a3
commit c5ebf34d7e
274 changed files with 58048 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
import validation from './test.js';
// 添加单位如果有rpx%px等单位结尾或者值为auto直接返回否则加上rpx单位结尾
export default function addUnit(value = 'auto', unit = 'rpx') {
value = String(value);
// 用uView内置验证规则中的number判断是否为数值
return validation.number(value) ? `${value}${unit}` : value;
}