在quill工具栏配置添加自定义附件上传按钮
["uploadfile"], //自定义附件
,并添加自定义附件上传功能
modules: {
toolbar: {
container: [
["bold", "italic", "underline", "strike"],
["blockquote", "code-block"],
[{ list: "ordered" }, { list: "bullet" }],
[{ indent: "-1" }, { indent: "+1" }],
[{ size: ["small", false, "large", "huge"] }],
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ color: [] }, { background: [] }],
[{ align: [] }],
["clean"],
["link", "image", "video"],
["uploadfile"],
handlers: {
uploadfile: function (value) {
_that.uploadType = "uploadfile";
_that.accept = "application/*";
setTimeout(() => {
if (value) {
document.querySelector(".el-upload input").click();
} else {
_that.quill.format("uploadfile", false);
}, 100);
imageResize: {
displayStyles: {
backgroundColor: "black",
border: "none",
color: "white",
modules: ["Resize", "DisplaySize", "Toolbar"],