小程序开放平台

文档中心
表单组件
基础内容
icon
progress
rich-text
text
媒体组件
地图
视图容器
开放能力
画布

text

开发
>
组件
>
基础内容
>
text
>
更新时间:2024-11-13 19:05:26

text

文本

属性
类型
默认值
必填
说明
user-selectbooleanfalse文本是否可选,该属性会使文本节点显示为 inline-block
spacestring显示连续空格
decodebooleanfalse是否解码

扫码预览

组件示例

<view>
  <text>默认转义:&nbsp;&ensp;&emsp;&quot;&apos;&amp;&lt;&gt;\n</text>
  <text> ===== \n</text>
  <text>不转义 data 里的: {{decodeText}} \n</text>
  <text> ## decode ### \n</text>
  <text decode>&nbsp;&ensp;&emsp;&quot;&apos;&amp;&lt;&gt; \n</text>
  <text> ===== \n</text>
  <text decode>转义 data 里的 {{decodeText}}</text>
</view>
<view class="page-body">
  <view class="page-section page-section-spacing">
    <view class="text-box" scroll-y="true" scroll-top="{{scrollTop}}">
      <text>{{text}}</text>
    </view>
    <button disabled="{{!canAdd}}" bindtap="add">add line</button>
    <button disabled="{{!canRemove}}" bindtap="remove">remove line</button>
  </view>
</view>
该文档是否对您有帮助?