Json is converted to a string, and & quot;?

construct a json

let postData = {};
postData["text"] = msgContent
postData["headImage"] = that.$store.state.sendToUser.headImage
postData["nickname"] = that.$store.state.sendToUser.nickname

is converted into a string with JSON.stringify, and "

" appears in the string.
"{"text":"41","headImage":"https://img.codeshelper.com/upload/img/2021/06/15/u1sdhtw310r18061.jpg","nickname":""}"
Jun.15,2021
The escape character of

is. Don't use [], just use it. I don't think so.


< del > there will be no problem. The problem is whether you rendered with {{postData} or v-text . Replace it with v-html < del >

clipboard.png



clipboard.png


I also have the same problem. Is there a function in js that automatically channels such escape characters when parsing?

Menu