天天看点

微信小程序中 text组件里不能使用空格回车的解决办法

text

组件的

decode

属性设置为

true

就可以在

text

组建里使用 html编码后的字符和转义字符了,如:

<text decode='true'>&nbsp;\n</text>           

复制

这里面

&nbsp

\n

表示一个空格和回车。