-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
本地版本 1.6.4 ,https://docs-cn.nocobase.com/plugin-samples/block/block-carousel
参考这个教程发现,
import { SchemaSettingsItemType, useDesignable, } from "@nocobase/client";
import { useFieldSchema } from '@formily/react';
import { BlockNameLowercase } from "../../constants";
import { useT } from "../../locale";
export const imagesSchemaSettingsItem: SchemaSettingsItemType = {
name: 'images',
type: 'actionModal',
useComponentProps() {
const filedSchema = useFieldSchema();
const { deepMerge } = useDesignable();
const t = useT();
return {
title: t('Edit Images'),
schema: {
type: 'object',
title: t('Edit Images'),
properties: {
src: {
title: t('Images'),
type: 'string',
default: filedSchema['x-decorator-props'][BlockNameLowercase]?.images ?? [],
'x-decorator': 'FormItem',
'x-component': 'Upload.Attachment',
'x-component-props': {
action: 'attachments:create',
multiple: true
},
},
},
},
onSubmit({ src: images }: any) {
deepMerge({
'x-uid': filedSchema['x-uid'],
'x-decorator-props': {
...filedSchema['x-decorator-props'],
[BlockNameLowercase]: {
...filedSchema['x-decorator-props']?.[BlockNameLowercase],
images,
},
},
})
}
};
},
};
原图这个也没有出现上传图片,点击但是什么都没有发生
Metadata
Metadata
Assignees
Labels
No labels