deming/static/js/common.js
2020-07-06 17:32:29 +08:00

13 lines
379 B
JavaScript

const common = {
/**
* 转义富文本标签
* @param { String } temp 后台返回需要处理的富文本
* @return { String } 处理好的富文本
*/
unescapeHTML(temp){
if(!temp) return '';
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
}
export default common