Text

更新时间:
复制 MD 格式

Text, only nesting is supported within components.

Attributes

Attribute

Type

Default value

Description

Minimum version

selectable

Boolean

false

Whether it is optional

-

space

String

-

Display consecutive spaces

-

decode

Boolean

false

Decode or not

-

number-of-lines

number

-

Multi-line ellipsis, the value must be greater than or equal to 1, and the performance is consistent with the CSS -webkit-line-clamp attribute.

-

Valid values ​​for space

Value

Description

nbsp

Space size according to font settings

ensp

Half the size of a Chinese character space

emsp

Chinese character space size

Code example

<view class="page">
  <view class="text-view">
    <text>{{text}}</text>
  </view>
</view>
Page({
  data: {
    text: `Alipay is a large-scale lifestyle service platform, serving a wide variety of users ranging from middle-aged and elderly to teenagers.
      There are not only self-operated official apps, but also integrated third-party apps, to provide users with rich choices.
      Only if your product is simple enough can it be used by more users. And the more people use your product, the greater your gains.\ n\n:)
    `,
  },
})