fn_formatContent: function (content) {
let keyword = this.data.keyword || ''
let RegExp = new RegExp(keyword, 'g')
content = content.replace(/。|;/g, "。\n\n")
content = content.replace(/;/g, ";\n")
content = content.replace(RegExp, `<span class="keyword-text">${keyword}</span>`)
return content
}
报错如下:
VM244:1 (in promise) MiniProgramError
RegExp is not a constructor
TypeError: RegExp is not a constructor
let RegExp // let RegExp_ss
找个用其他变量试试,另外,检查下基础库