天天看點

将後端傳回的文本解析成html

解析前 

将後端傳回的文本解析成html

 解析後

将後端傳回的文本解析成html

代碼

const reg = new RegExp("\n", "g");
	res.data.notice = decodeURIComponent(res.data.notice).replace(reg,"<br>");
	this.notice = res.data.notice