运行schema2code,看function getValidator代码块
- 发布:2021-05-15 12:01
- 更新:2021-06-02 17:03
- 阅读:538
产品分类: HbuilderX
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 10.14.6
HBuilderX版本号: 3.1.12
操作步骤:
预期结果:
function getValidator(fields) {
let result = {}
for (let key in validator) {
if (fields.includes(key)) {
result[key] = validator[key]
}
}
return result
}
function getValidator(fields) {
let result = {}
for (let key in validator) {
if (fields.includes(key)) {
result[key] = validator[key]
}
}
return result
}
实际结果:
function getValidator(fields) {
let reuslt = {}
for (let key in validator) {
if (fields.includes(key)) {
reuslt[key] = validator[key]
}
}
return reuslt
}
function getValidator(fields) {
let reuslt = {}
for (let key in validator) {
if (fields.includes(key)) {
reuslt[key] = validator[key]
}
}
return reuslt
}
bug描述:
下面是schema2code生成的表单验证代码
function getValidator(fields) {
let reuslt = {}
for (let key in validator) {
if (fields.includes(key)) {
reuslt[key] = validator[key]
}
}
return reuslt
}
result 拼错成了 reuslt
很难受,能改过来吗?官方uni-admin中的代码也都有这个问题
1 个回复
DCloud_uni-ad_HDX
感谢反馈,虽然不影响功能,名字看上去确实别扭,下版修复