js去除html字符串中的style样式:
let content = res.content.content content = content?.replace(/style\s*?=\s*?(['"])[\s\S]*?\1/gi, '') content = content?.replace(/\<img /gi, '<img style="max-width:100%;height:auto;"') detail.value = content
使用:
<rich-text class="rich-text" :nodes="detail"></rich-text>