Commit a9d98134 authored by renjintao's avatar renjintao

handImg

parent 393f7c95
...@@ -103,6 +103,27 @@ export default { ...@@ -103,6 +103,27 @@ export default {
} }
}) })
}, },
handleImg(e) {
console.warn(e)
let file = null
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf('image') > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile()
let reader = new FileReader()
reader.readAsDataURL(file)
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>'
this.entity.note += img
}, 1000)
// new R
}
},
handleClose() { handleClose() {
this.$emit('on-close') this.$emit('on-close')
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment