|
@@ -44,3 +44,25 @@ export async function audioHandle(event) {
|
|
|
document.execCommand("insertHTML", false, imageNode.outerHTML);
|
|
|
this.$emit("audio-added");
|
|
|
}
|
|
|
+
|
|
|
+export async function uploadAudioHandle(file) {
|
|
|
+ this.$refs.editor.focus();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ const res = await saveAudioApi({ file });
|
|
|
+ console.log(res.data);
|
|
|
+
|
|
|
+ const imageNode = await audioToImageNode(res.data);
|
|
|
+ console.log(imageNode);
|
|
|
+
|
|
|
+
|
|
|
+ document.execCommand("insertHTML", false, imageNode.outerHTML);
|
|
|
+ this.$emit("audio-added");
|
|
|
+}
|