Skip to content

Commit

Permalink
fix:File names are not processed by default when uploading (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh425 authored May 12, 2022
1 parent 15def71 commit 7125043
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Masa.Blazor/wwwroot/js/vditor/vditor-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cache: {
enable: false,
},
icon:'material'
icon: 'material'
}


Expand All @@ -33,6 +33,7 @@ export function init(domRef, obj, value, options, isUploadHandler) {
}
}
}
SetDefaultFileNameHandle(vditorOptions);
domRef.Vditor = new Vditor(domRef, {
...vditorOptions,
value,
Expand Down Expand Up @@ -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);
}

0 comments on commit 7125043

Please sign in to comment.