feat: 🚀 切换富文本编辑器

This commit is contained in:
2025-05-07 17:55:49 +08:00
parent 4bd5797772
commit ab003714bf
28 changed files with 1145 additions and 132 deletions

View File

@@ -0,0 +1,20 @@
import { Quill } from "@vueup/vue-quill";
let BlockEmbed = Quill.import("blots/block/embed");
class ImageBlot extends BlockEmbed {
static create(value) {
let node = super.create();
node.setAttribute("src", value.url);
node.setAttribute("id", value.id);
return node;
}
static value(node) {
return {
url: node.getAttribute("src"),
id: node.getAttribute("id")
};
}
}
ImageBlot.blotName = "image";
ImageBlot.tagName = "img";
export default ImageBlot;