mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:06:22 +00:00
fix(vditor): file collection is not empty
This commit is contained in:
parent
674093e84c
commit
97d9136230
@ -18,7 +18,7 @@ export const Edit = withDynamicSchemaProps((props) => {
|
|||||||
const { wrapSSR, hashId, componentCls: containerClassName } = useStyle();
|
const { wrapSSR, hashId, componentCls: containerClassName } = useStyle();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const uploadFileCollection = fileCollection ?? 'attachments';
|
const uploadFileCollection = fileCollection || 'attachments';
|
||||||
const toolbarConfig = toolbar ?? defaultToolbar;
|
const toolbarConfig = toolbar ?? defaultToolbar;
|
||||||
const vditor = new Vditor(containerRef.current, {
|
const vditor = new Vditor(containerRef.current, {
|
||||||
value: value ?? '',
|
value: value ?? '',
|
||||||
@ -51,7 +51,7 @@ export const Edit = withDynamicSchemaProps((props) => {
|
|||||||
onChange(value);
|
onChange(value);
|
||||||
},
|
},
|
||||||
upload: {
|
upload: {
|
||||||
url: app.getApiUrl(`${uploadFileCollection ?? 'attachments'}:create`),
|
url: app.getApiUrl(`${uploadFileCollection}:create`),
|
||||||
headers: apiClient.getHeaders(),
|
headers: apiClient.getHeaders(),
|
||||||
multiple: false,
|
multiple: false,
|
||||||
fieldName: 'file',
|
fieldName: 'file',
|
||||||
|
@ -16,7 +16,7 @@ export class PluginFieldMarkdownVditorClient extends Plugin {
|
|||||||
getCDN() {
|
getCDN() {
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
// 开发模式下使用远程 cdn
|
// 开发模式下使用远程 cdn
|
||||||
return 'https://cdn.jsdelivr.net/npm/vditor@3.10.4';
|
return 'https://unpkg.com/vditor@3.10.4';
|
||||||
}
|
}
|
||||||
// 生产环境,使用本地链接,支持内网
|
// 生产环境,使用本地链接,支持内网
|
||||||
// 需要支持子目录,比如应用部署在 /xxx/ 目录下
|
// 需要支持子目录,比如应用部署在 /xxx/ 目录下
|
||||||
|
Loading…
Reference in New Issue
Block a user