mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-21 13:52:17 +08:00
fix: bug
This commit is contained in:
@@ -703,6 +703,7 @@ export class CollectionField {
|
||||
multiple: target ? ['belongsToMany', 'hasMany', 'belongsToArray'].includes(type) : undefined,
|
||||
maxCount: target && !['belongsToMany', 'hasMany', 'belongsToArray'].includes(type) ? 1 : undefined,
|
||||
target: target,
|
||||
template: this.targetCollection?.template,
|
||||
},
|
||||
_.isUndefined,
|
||||
);
|
||||
|
||||
+3
-4
@@ -230,11 +230,10 @@ const Preview = (props) => {
|
||||
};
|
||||
export class DisplayPreviewFieldModel extends FieldModel {
|
||||
render(): any {
|
||||
const { value, titleField, target } = this.props;
|
||||
if (titleField && target !== 'file') {
|
||||
const { value, titleField, template } = this.props;
|
||||
if (titleField && template !== 'file') {
|
||||
return castArray(value).flatMap((v, idx) => {
|
||||
const res = v?.[titleField];
|
||||
const result = typeof res === 'object' ? res : v;
|
||||
const result = v?.[titleField];
|
||||
const content = result ? (
|
||||
<Preview key={idx} {...this.props} value={castArray(result)} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user