fix(amis-editor): 公式编辑器弹窗,会缓存已删除的内容 (#8314)

Co-authored-by: wutong25 <wutong25@baidu.com>
This commit is contained in:
wutong 2023-10-08 18:48:23 +08:00 committed by GitHub
parent b802f54205
commit ef95033228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -381,7 +381,7 @@ export class SelectControlPlugin extends BasePlugin {
title: node.schema?.label || node.schema?.name,
originalValue: node.schema?.value // 记录原始值,循环引用检测需要
};
debugger;
if (node.schema?.joinValues === false) {
dataSchema = {
...dataSchema,

View File

@ -4,7 +4,7 @@ import cx from 'classnames';
import FormulaEditor from 'amis-ui/lib/components/formula/Editor';
export interface FormulaPickerProps {
onConfirm: (data: string) => void;
onConfirm: (data: string | undefined) => void;
onClose: () => void;
variables: any[];
value?: string;
@ -23,10 +23,10 @@ export interface CustomFormulaPickerProps extends FormulaPickerProps {
const FormulaPicker: React.FC<FormulaPickerProps> = props => {
const {variables, variableMode, evalMode = true} = props;
const [formula, setFormula] = React.useState('');
const [formula, setFormula] = React.useState<string | undefined>(undefined);
useEffect(() => {
const {initable, value} = props;
if (initable && value) {
if (initable) {
setFormula(value);
}
}, [props.value]);