Skip to content

Commit

Permalink
fix: 修复查询valueChange 修改form无效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jan 24, 2024
1 parent f4f121f commit 93808f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/crud/advanced/linkage/crud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
title: "省",
type: "dict-select",
search: {
show: true
show: true,
valueChange({ form, value, getComponentRef }) {
form.city = undefined; // 将“city”的值置空
form.county = undefined; // 将“county”的值置空
if (value) {
getComponentRef("city").reloadDict(); // 执行city的select组件的reloadDict()方法,触发“city”重新加载字典
}
}
},
dict: dict({
url: "/mock/linkage/province",
Expand Down

0 comments on commit 93808f8

Please sign in to comment.