text

Text, supporting only nesting within component.

Attribute NameTypeDefaultDescriptionMinimum Version
selectableBooleanfalseselectable or not
spaceStringshow continuous spaces
decodeBooleanfalsedecode or not
number-of-linesnumberMulti-line omission, value must be greater than or equal to 1, same behavior as the -webkit-line-clamp attribute of css

Space Effective Value:

ValueDescription
nbspspace size as per font setting
ensphalf-size space of Chinese character
emspspace size of Chinese character

Sample Code

copy
<view class="page">
  <view class="text-view">
    <text>{{text}}</text>
  </view>
</view>
copy
Page({
  data: {
    text: 'Hello Mini Program',
  },
})