getXieyi() {
getXieyi(this.type).then(res => {
console.log(res);
this.info = res.data;
if (this.info.context.indexOf('style') == -1) {
this.info.context = this.info.context.replace(/(<img\s+.*?)(.*?)(.*?>)/g, function(
match, p1, p2, p3) {
var newStyle = 'style="width:100%;height:auto;"';
return p1 + newStyle + p3;
});
} else {
this.info.context = this.info.context.replace(/(<img\s+.*?style=")(.*?)(".*?>)/g, function(
match, p1, p2, p3) {
var newStyle = 'width:100%;height:auto;';
return p1 + newStyle + p3;
});
}
})
}