修改富文本禁止粘贴
This commit is contained in:
+3
-3
@@ -236,7 +236,7 @@
|
|||||||
modules: {
|
modules: {
|
||||||
clipboard: {
|
clipboard: {
|
||||||
// 粘贴版,处理粘贴时候带图片
|
// 粘贴版,处理粘贴时候带图片
|
||||||
matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
|
matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]],
|
||||||
},
|
},
|
||||||
toolbar: {
|
toolbar: {
|
||||||
container: toolbarOptions, // 工具栏
|
container: toolbarOptions, // 工具栏
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
Delta.ops.forEach(op => {
|
Delta.ops.forEach(op => {
|
||||||
if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,如果是字符串则可以添加
|
if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,如果是字符串则可以添加
|
||||||
ops.push({
|
ops.push({
|
||||||
insert: op.insert
|
insert: op.insert,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -461,7 +461,7 @@
|
|||||||
let index1 = fileName.lastIndexOf('.')
|
let index1 = fileName.lastIndexOf('.')
|
||||||
let index2 = fileName.length
|
let index2 = fileName.length
|
||||||
let fileSuffix = fileName.substring(index1, index2)
|
let fileSuffix = fileName.substring(index1, index2)
|
||||||
quill.insertEmbed(length, 'image', window._CONFIG['domianPreviewURL'] + '/sys/common/download/' + file.response.result.id + fileSuffix)
|
quill.insertEmbed(length, 'image', window._CONFIG['domianPreviewURL']+'/sys/common/download/'+file.response.result.id+fileSuffix)
|
||||||
quill.setSelection(length + 1)
|
quill.setSelection(length + 1)
|
||||||
this.quillUpdateImg = false
|
this.quillUpdateImg = false
|
||||||
} else if (status === 'uploading') {
|
} else if (status === 'uploading') {
|
||||||
|
|||||||
Reference in New Issue
Block a user