Skip to content

Commit

Permalink
fix(amis-editor): 修复switch配置truevalue/falsevalue后,默认值不更新问题 (baidu#9305)
Browse files Browse the repository at this point in the history
  • Loading branch information
pingbaobao authored Jan 5, 2024
1 parent df4d287 commit 5fd26a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/amis-editor/src/plugin/Form/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,12 @@ export class SwitchControlPlugin extends BasePlugin {
: value;
},
pipeOut: (value: any, origin: any, data: any) => {
return value && value === (data.trueValue || true)
? data.trueValue || true
: value && value !== (data.falseValue || false)
const {trueValue = true, falseValue = false} = data || {};
return value && value === trueValue
? trueValue
: value && value !== falseValue
? value
: data.falseValue || false;
: falseValue;
}
}),
getSchemaTpl('labelRemark'),
Expand Down

0 comments on commit 5fd26a8

Please sign in to comment.