小程序text中空格使用

小程序text中空格使用


详情:https://developers.weixin.qq.com/miniprogram/dev/component/text.html

一个空格

在输出内容中 一个空格可以使用 空格键或者是 \t 实现 但是无论连着使用多少次也是一个空格

连续空格
  • &nbsp,&ensp,emsp
    小程序text中空格使用
    <text wx:for="{{item.casts}}" decode="{{true}}" space="{{true}}"> {{item.name}} &nbsp;</text>

    注意设置属性否则无效
    小程序text中空格使用

  • 使用 \r\t\r\t\r\t\r\t…
    在\t前加\r