| | |
| | | this.quill.format("image", false); |
| | | } |
| | | }); |
| | | toolbar.addHandler("video", (value) => { |
| | | this.uploadType = "video"; |
| | | if (value) { |
| | | this.$refs.upload.$children[0].$refs.input.click(); |
| | | } else { |
| | | this.quill.format("video", false); |
| | | } |
| | | }); |
| | | // toolbar.addHandler("video", (value) => { |
| | | // this.uploadType = "video"; |
| | | // if (value) { |
| | | // this.$refs.upload.$children[0].$refs.input.click(); |
| | | // } else { |
| | | // this.quill.format("video", false); |
| | | // } |
| | | // }); |
| | | } |
| | | this.Quill.pasteHTML(this.currentValue); |
| | | this.Quill.on("text-change", (delta, oldDelta, source) => { |
| | |
| | | // 获取光标所在位置 |
| | | let length = quill.getSelection().index; |
| | | // 插入图片 res.url为服务器返回的图片地址 |
| | | quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName); |
| | | quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.data.fileName); |
| | | // 调整光标到最后 |
| | | quill.setSelection(length + 1); |
| | | } else { |