|
@@ -1,19 +1,21 @@
|
|
|
|
|
|
import {Quill} from 'vue-quill-editor'
|
|
|
const BlockEmbed = Quill.import('blots/block/embed')
|
|
|
+const inline = Quill.import('blots/inline')
|
|
|
// 添加插入图片
|
|
|
class ImageBlot extends BlockEmbed {
|
|
|
static create(value) {
|
|
|
const node = super.create(value)
|
|
|
+ console.log(node)
|
|
|
node.setAttribute('src', value.url)
|
|
|
// node.setAttribute('title', value.name)
|
|
|
// node.setAttribute('controls', value.controls)
|
|
|
// node.setAttribute('controlslist', value.controlslist)
|
|
|
node.setAttribute('width', value.width)
|
|
|
node.setAttribute('height', value.height)
|
|
|
- node.setAttribute('webkit-playsinline', true)
|
|
|
- node.setAttribute('playsinline', true)
|
|
|
- node.setAttribute('x5-playsinline', true)
|
|
|
+ // node.setAttribute('webkit-playsinline', true)
|
|
|
+ // node.setAttribute('playsinline', true)
|
|
|
+ // node.setAttribute('x5-playsinline', true)
|
|
|
node.setAttribute('style', value.style)
|
|
|
// if (value.autoplay) {
|
|
|
// node.setAttribute('autoplay', value.autoplay)
|
|
@@ -37,4 +39,21 @@ class ImageBlot extends BlockEmbed {
|
|
|
|
|
|
ImageBlot.blotName = 'image' //quill使用时的名称
|
|
|
ImageBlot.tagName = 'img' //定义的html标签名
|
|
|
-Quill.register(ImageBlot) // 注册
|
|
|
+// Quill.register(ImageBlot) // 注册
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class WordBox extends inline {
|
|
|
+ static create(value) {
|
|
|
+ const node = super.create(value);
|
|
|
+ //设置需要的样式
|
|
|
+ node.setAttribute('style', 'width:80px;height: 80px;border: 1px solid #f9f6f675;vertical-align:middle');
|
|
|
+ return node;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+WordBox.blotName = 'wordBox'; //工具栏中的名字与此名字需保持一致
|
|
|
+WordBox.tagName = 'wordBox'; //需要添加的标签名
|
|
|
+
|
|
|
+Quill.register(WordBox);
|