mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
fix: json view 自动尝试解析字符串 (#3239)
This commit is contained in:
parent
999add819f
commit
a32fca4048
@ -94,6 +94,11 @@ export class JSONField extends React.Component<JSONProps, object> {
|
||||
let data = value;
|
||||
if (source !== undefined && isPureVariable(source)) {
|
||||
data = resolveVariableAndFilter(source, this.props.data, '| raw');
|
||||
} else if (typeof value === 'string') {
|
||||
// 尝试解析 json
|
||||
try {
|
||||
data = JSON.parse(value);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
let jsonThemeValue = jsonTheme;
|
||||
|
Loading…
Reference in New Issue
Block a user