text

Text, supporting only nesting within component.
Scan QR code to try:

text

Property

TypeDefaultDescription
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 character.
emspSpace size of character.

Sample Code

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