Mini Program's backend returns the front end data with\ ntransfer, but the front end does not wrap

clipboard.png

wxml
n

clipboard.png

clipboard.png

clipboard.png

Apr.09,2021

you can only use the text component. Check


< del > \ n replace with
. < / del >
< del > \ n is generated by line wrapping in the input box.
< / del >

is required in the actual html tag. < hr >

if \ n is escaped as "\ n" , you can replace the newline character

with "qwe\ n123" .replace (/\ nUnimax g, "n"). The

backend returns another split symbol, and the mini program end is replaced by n


.

should be a problem of JS string recognition. I just encountered it in web application, which is probably a reason. Just replace it directly:

data = data.replace('\n', '\n');
Menu