富文本。
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
nodes | array,string | 节点列表/HTML String |
<view class="page-section"> <view class="page-section-title">通过HTML String渲染</view> <view class="page-content"> <scroll-view scroll-y>{{htmlSnip}}</scroll-view> <button type="primary" bindtap="renderHtml">渲染HTML</button> <block xhs:if="{{renderedByHtml}}"> <rich-text nodes="{{htmlSnip}}"></rich-text> </block> </view> </view> <view class="page-section"> <view class="page-section-title">通过节点渲染</view> <view class="page-content"> <scroll-view scroll-y>{{nodeSnip}}</scroll-view> <button type="primary" bindtap="renderNode">渲染Node</button> <block xhs:if="{{renderedByNode}}"> <rich-text nodes="{{nodes}}"></rich-text> </block> </view> </view> </view>