修复插入图片设置最大宽度100%的bug
parent
36ced2378c
commit
705c666202
|
@ -244,10 +244,6 @@ class Editor extends Component {
|
||||||
outline: none;
|
outline: none;
|
||||||
text-wrap: wrap;
|
text-wrap: wrap;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|
||||||
|
@ -447,13 +443,8 @@ class Editor extends Component {
|
||||||
send: link => {
|
send: link => {
|
||||||
this.$refs.editor.focus()
|
this.$refs.editor.focus()
|
||||||
this.restoreSelection()
|
this.restoreSelection()
|
||||||
this.exec(ACTTION.image, link)
|
this.exec(ACTTION.html, `<img src="${link}" style="max-width:100%" >`)
|
||||||
this.saveSelection()
|
this.saveSelection()
|
||||||
|
|
||||||
// 修正插入的图片,宽度不得超出容器
|
|
||||||
this.$refs.editor.querySelectorAll('img').forEach(_ => {
|
|
||||||
_.style.maxWidth = '100%'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue