富文本去除标签的正则使用

28 阅读1分钟
subText(str) {
        let reg = /<[^>]*>/g
        return str.replaceAll(reg, '').replaceAll('&nbsp;', '') || '')
      }