mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
修复 DiffEditor diffValue 显示 [Object object] 的问题 (#1050)
* Iframe 联动时导致 iframe 刷新问题 * src过期判断有问题 * iframe message事件监听器判断优化 * 修复 DiffEditor 显示 [Object object] 的问题
This commit is contained in:
parent
8b36762b91
commit
0af075b3e5
@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import {Renderer} from '../../factory';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
||||
import {filter} from '../../utils/tpl';
|
||||
import cx from 'classnames';
|
||||
import LazyComponent from '../../components/LazyComponent';
|
||||
import debouce from 'lodash/debounce';
|
||||
import {isPureVariable} from '../../utils/tpl-builtin';
|
||||
import {
|
||||
isPureVariable,
|
||||
resolveVariableAndFilter
|
||||
} from '../../utils/tpl-builtin';
|
||||
import {SchemaTokenizeableString} from '../../Schema';
|
||||
import {autobind} from '../../utils/helper';
|
||||
|
||||
@ -132,7 +132,10 @@ export class DiffEditor extends React.Component<DiffEditorProps, any> {
|
||||
.getModel()
|
||||
.setValue(
|
||||
isPureVariable(diffValue as string)
|
||||
? normalizeValue(filter(diffValue || '', data, '| raw'), language)
|
||||
? normalizeValue(
|
||||
resolveVariableAndFilter(diffValue || '', data, '| raw'),
|
||||
language
|
||||
)
|
||||
: normalizeValue(diffValue, language)
|
||||
);
|
||||
}
|
||||
@ -183,7 +186,10 @@ export class DiffEditor extends React.Component<DiffEditorProps, any> {
|
||||
this.editor.setModel({
|
||||
original: this.monaco.editor.createModel(
|
||||
isPureVariable(diffValue as string)
|
||||
? normalizeValue(filter(diffValue || '', data, '| raw'), language)
|
||||
? normalizeValue(
|
||||
resolveVariableAndFilter(diffValue || '', data, '| raw'),
|
||||
language
|
||||
)
|
||||
: normalizeValue(diffValue, language),
|
||||
language
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user