diff --git a/src/Masa.Blazor/wwwroot/js/vditor/vditor-helper.js b/src/Masa.Blazor/wwwroot/js/vditor/vditor-helper.js index eaefe5140d..e5db6b343d 100644 --- a/src/Masa.Blazor/wwwroot/js/vditor/vditor-helper.js +++ b/src/Masa.Blazor/wwwroot/js/vditor/vditor-helper.js @@ -8,7 +8,7 @@ cache: { enable: false, }, - icon:'material' + icon: 'material' } @@ -33,6 +33,7 @@ export function init(domRef, obj, value, options, isUploadHandler) { } } } + SetDefaultFileNameHandle(vditorOptions); domRef.Vditor = new Vditor(domRef, { ...vditorOptions, value, @@ -74,3 +75,7 @@ export function insertValue(domRef, value, render = true) { export function destroy(domRef) { domRef.Vditor.destroy(); } +function SetDefaultFileNameHandle(vditorOptions) { + let { upload } = vditorOptions; + if (upload) upload.filename || (upload.filename = (name) => name); +}