|
@@ -125,7 +125,7 @@ export default {
|
|
|
const srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i
|
|
|
const imgArr = newStr.match(imgReg)
|
|
|
imgArr && imgArr.map(async t => {
|
|
|
- var src = t.match(srcReg)
|
|
|
+ const src = t.match(srcReg)
|
|
|
if (src[1] && src[1].includes('data:image')) {
|
|
|
const newImgUrl = await uploadImg(src[1])
|
|
|
newStr = newStr.replace(src[1], newImgUrl)
|
|
@@ -133,7 +133,12 @@ export default {
|
|
|
this.inputValue = newStr
|
|
|
// 光标最后
|
|
|
this.$nextTick(() => {
|
|
|
- var ifra = document.getElementById(`tinymce_${this.id}_ifr`)
|
|
|
+ let ifra
|
|
|
+ if (document.getElementById(`tinymce_${this.id}_ifr`)) {
|
|
|
+ ifra = document.getElementById(`tinymce_${this.id}_ifr`)
|
|
|
+ } else {
|
|
|
+ ifra = document.getElementById(`tiny-vue_${this.id}_ifr`)
|
|
|
+ }
|
|
|
keepLastIndex(ifra.contentWindow.document.getElementById(`tinymce`), ifra.contentWindow)
|
|
|
})
|
|
|
}
|