mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复crud里面使用文本假数据/列表组件渲染报错
This commit is contained in:
parent
df51aa5b27
commit
ff32040f7b
@ -80,7 +80,7 @@ export class NodeWrapper extends React.Component<NodeWrapperProps> {
|
||||
|
||||
// 自动合并假数据
|
||||
if (isObject(mockProps) && !isEmpty(mockProps)) {
|
||||
rest = merge({}, rest, mockProps);
|
||||
rest = merge(rest, mockProps);
|
||||
}
|
||||
|
||||
if ($$editor.renderRenderer) {
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
||||
import {diff, JSONPipeOut, repeatArray} from 'amis-editor-core';
|
||||
import set from 'lodash/set';
|
||||
import merge from 'lodash/merge';
|
||||
import {escapeFormula, resolveArrayDatasource} from '../util';
|
||||
|
||||
export class CardsPlugin extends BasePlugin {
|
||||
@ -574,7 +575,12 @@ export class CardsPlugin extends BasePlugin {
|
||||
props.className = `${props.className || ''} ae-Editor-list`;
|
||||
props.itemsClassName = `${props.itemsClassName || ''} cards-items`;
|
||||
if (props.card && !props.card.className?.includes('listItem')) {
|
||||
props.card.className = `${props.card.className || ''} ae-Editor-listItem`;
|
||||
props.card = merge(
|
||||
{
|
||||
className: `${props.card.className || ''} ae-Editor-listItem`
|
||||
},
|
||||
props.card
|
||||
);
|
||||
}
|
||||
|
||||
// 列表类型内的文本元素显示原始公式
|
||||
|
@ -4,7 +4,8 @@ import {EditorNodeType, registerEditorPlugin} from 'amis-editor-core';
|
||||
import {BaseEventContext, BasePlugin} from 'amis-editor-core';
|
||||
import {getSchemaTpl} from 'amis-editor-core';
|
||||
import {escapeFormula} from '../util';
|
||||
import {set} from 'lodash';
|
||||
import merge from 'lodash/merge';
|
||||
import set from 'lodash/set';
|
||||
|
||||
export class EachPlugin extends BasePlugin {
|
||||
static id = 'EachPlugin';
|
||||
@ -362,10 +363,13 @@ export class EachPlugin extends BasePlugin {
|
||||
props.value = [{}, {}];
|
||||
|
||||
props.className = `${props.className || ''} ae-Editor-list`;
|
||||
if (props.items && !props.items.className?.includes('listItem')) {
|
||||
props.items.className = `${
|
||||
props.items.className || ''
|
||||
} ae-Editor-eachItem`;
|
||||
if (props.items && !props.items.className?.includes('eachItem')) {
|
||||
props.items = merge(
|
||||
{
|
||||
className: `${props.items.className || ''} ae-Editor-eachItem`
|
||||
},
|
||||
props.items
|
||||
);
|
||||
}
|
||||
|
||||
return props;
|
||||
|
@ -12,6 +12,7 @@ import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
||||
import {repeatArray} from 'amis-editor-core';
|
||||
import set from 'lodash/set';
|
||||
import {escapeFormula, resolveArrayDatasource} from '../util';
|
||||
import merge from 'lodash/merge';
|
||||
|
||||
export class List2Plugin extends BasePlugin {
|
||||
static id = 'List2Plugin';
|
||||
@ -450,7 +451,12 @@ export class List2Plugin extends BasePlugin {
|
||||
props.className = `${props.className || ''} ae-Editor-list`;
|
||||
props.itemsClassName = `${props.itemsClassName || ''} cards-items`;
|
||||
if (props.card && !props.card.className?.includes('listItem')) {
|
||||
props.card.className = `${props.card.className || ''} ae-Editor-listItem`;
|
||||
props.card = merge(
|
||||
{
|
||||
className: `${props.card.className || ''} ae-Editor-listItem`
|
||||
},
|
||||
props.card
|
||||
);
|
||||
}
|
||||
|
||||
// 列表类型内的文本元素显示原始公式
|
||||
|
Loading…
Reference in New Issue
Block a user