All Products
Search
Document Center

Text

Last Updated: Feb 04, 2021

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

  1. <view class="page">
  2. <view class="text-view">
  3. <text>{{text}}</text>
  4. </view>
  5. </view>
  1. Page({
  2. data: {
  3. text: `The mobile development platform (Mobile PaaS and mPaaS for short) is a mobile development platform derived from the Alipay app`,
  4. },
  5. })