Skip to content

Commit

Permalink
Merge pull request #954 from dcloudio/fix-forms-binddata
Browse files Browse the repository at this point in the history
fix(forms):修复uni-forms的binddata的兼容性问题
  • Loading branch information
GRCmade authored Sep 14, 2024
2 parents 6f9613e + 5bdd579 commit 2877447
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions uni_modules/uni-forms/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.4.11 (2024-9-14)
- 修复 binddata的兼容性问题
## 1.4.10(2023-11-03)
- 优化 labelWidth 描述错误
## 1.4.9(2023-02-10)
Expand Down
10 changes: 6 additions & 4 deletions uni_modules/uni-forms/components/uni-forms/uni-forms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,17 @@
}
}
if (!formVm) return console.error('当前 uni-froms 组件缺少 ref 属性');
formVm.setValue(name, value);
if(formVm.model)formVm.model[name] = value
if(formVm.modelValue)formVm.modelValue[name] = value
if(formVm.value)formVm.model[name] = value
}
}
}
// #endif
// 子组件实例数组
this.childrens = []
// TODO 兼容旧版 uni-data-picker ,新版本中无效,只是避免报错
this.childrens = []
// TODO 兼容旧版 uni-data-picker ,新版本中无效,只是避免报错
this.inputChildrens = []
this.setRules(this.rules)
},
Expand Down Expand Up @@ -394,4 +396,4 @@

<style lang="scss">
.uni-forms {}
</style>
</style>
2 changes: 1 addition & 1 deletion uni_modules/uni-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "uni-forms",
"displayName": "uni-forms 表单",
"version": "1.4.10",
"version": "1.4.11",
"description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
"keywords": [
"uni-ui",
Expand Down

0 comments on commit 2877447

Please sign in to comment.