天天看點

微信小程式中 text元件裡不能使用空格回車的解決辦法

text

元件的

decode

屬性設定為

true

就可以在

text

組建裡使用 html編碼後的字元和轉義字元了,如:

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

複制

這裡面

&nbsp

\n

表示一個空格和回車。