toStrings(str){
const HTMLEncode = html => {
let tmp = document.createElement('div');
(tmp.textContent != null) ? (tmp.textContent = html) : (tmp.innerText = html);
const output = tmp.innerHTML;
tmp = null;
console.log(output);
return output;
};
return HTMLEncode(str)
},
this.toString("<h1>2222<h1>"). // 页面输出<h1>2222<h1>
vue html 标签转义
最新推荐文章于 2024-04-05 16:50:27 发布