<vxe-modal v-model="recordShowModal" title="病例详情" width="980px" height="calc(100vh - 100px)" :resize='true'>
<div v-html="pageContent"> </div>
</vxe-modal>
let formData = {
'content': this.content,
'checkinDignoseName': row.data[row.$rowIndex].checkinDignoseNames,
'hisName': row.data[row.$rowIndex].hisNames
}
let htmlContent = formData.content;
var pararm = undefined;
if(formData.checkinDignoseName != null) {
pararm = formData.checkinDignoseName.replace('(','\\(').replace(')','\\)')
}
if(formData.hisName != null) {
pararm = pararm + '|' + formData.hisName.replace('(','\\(').replace(')','\\)')
}
let str = htmlContent.split('body')[1];
this.pageContent = str.slice(str.indexOf('>') + 1, -2);
var re=new RegExp('(' + pararm + ')','gi');//注意改这里
this.pageContent = str.slice(str.indexOf('>') + 1, -2).replace(re,'<font class="higtLight">$1</font>');
是不是编码问题,导致识别不是html
使用v-html 渲染的吗