fix: 修复 property 在 amis-formula 下 source 属性获取值不正确问题 (#3089)

This commit is contained in:
吴多益 2021-11-29 22:21:12 +08:00 committed by GitHub
parent d7770bc6fb
commit 5691a0170e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,8 +5,7 @@
import React from 'react';
import {Renderer, RendererProps} from '../factory';
import {BaseSchema, SchemaExpression, SchemaObject, SchemaTpl} from '../Schema';
import PopOver from './PopOver';
import {resolveVariable, resolveVariableAndFilter} from '../utils/tpl-builtin';
import {resolveVariableAndFilter} from '../utils/tpl-builtin';
import {visibilityFilter} from '../utils/helper';
export type PropertyItemProps = {
@ -119,12 +118,14 @@ export default class Property extends React.Component<PropertyProps, object> {
*/
prepareRows() {
const {column = 3, items, source, data} = this.props;
const propertyItems =
(items
? items
: (resolveVariableAndFilter(source, data) as Array<PropertyItem>)) ||
[];
: (resolveVariableAndFilter(
source,
data,
'| raw'
) as Array<PropertyItem>)) || [];
const rows: PropertyContent[][] = [];