Only <text/> nesting is supported within the text component.
| Attribute |
Type |
Default value |
Description |
The minimum version. |
| selectable |
Boolean |
false |
Selectable. |
- |
| space |
String |
- |
Display consecutive spaces. |
- |
| decode |
Boolean |
false |
Whether to decode. |
- |
| number-of-lines |
number |
- |
Multiple lines of ellipses, whose value must be equal to or greater than 1. The effect of this attribute is consistent with that of the CSS -webkit-line-clamp attribute. |
- |
Possible space values are as follows:
| Value |
Description |
| nbsp |
The space size set based on the font. |
| ensp |
The half size of a full-width space. |
| emsp |
The size of a full-width space. |
Code sample
<view class="page"> <view class="text-view"> <text>{{text}}</text> </view></view>
Page({ data: { text: `The mobile development platform (Mobile PaaS and mPaaS for short) is a mobile development platform derived from the Alipay app`, },})