Represents the text.
Since: 1.0.0
Only text components can be nested within the text component; nesting other components is ineffective.
Name | Type | Default Value | Mandatory | Description |
|---|---|---|---|---|
user-select | boolean | false | No | Whether it is selectable. |
space | string | emsp | No | How consecutive spaces are rendered. Valid values:
If a value other than the above is set, the component will directly display the spaces entered by the developer. |
decode | boolean | false | No | Whether to decode. For example, < will be displayed as <. Values can be parsed: ', >, <, &,  ,  , and . |
<view>
<view class="text-box">
<text user-select="{{true}}">This is a piece of text that can be selected.</text>
</view>
<view class="text-box">
<text space="ensp">This is an ensp space.</text>
</view>
<view class="text-box">
<text space="emsp">This is an emsp space.</text>
</view>
<view class="text-box">
<text space="nbsp">This is a nbsp space.</text>
</view>
</view>