1、图片的处理
updated() {
//处理富文本内图片适配
let DomList = document
.getElementsByClassName('text')[0]
.querySelectorAll('img');
for (let i in DomList) {
if (DomList[i].style) {
DomList[i].style.width = '300px';
DomList[i].style.height = '200px';
DomList[i].style.marginBottom = '10px';
}
}
},
2、表格的处理
updated() {
//处理富文本内table适配
let DomList = document.querySelectorAll('table');
for (let i in DomList) {
if (DomList[i].style) {
DomList[i].style.width = '100%';
DomList[i].style.margin = '10px 0';
DomList[i].border = '1';
}
}
},