rich-text.wxml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container page" data-weui-theme="{{theme}}">
  4. <template is="head" data="{{title: 'rich-text'}}"/>
  5. <view class="page-body">
  6. <view class="page-section">
  7. <view class="page-section-title">通过HTML String渲染</view>
  8. <view class="page-content">
  9. <scroll-view scroll-y>{{htmlSnip}}</scroll-view>
  10. <button type="primary" bindtap="renderHtml">渲染HTML</button>
  11. <block wx:if="{{renderedByHtml}}">
  12. <rich-text nodes="{{htmlSnip}}"></rich-text>
  13. </block>
  14. </view>
  15. </view>
  16. <view class="page-section">
  17. <view class="page-section-title">通过节点渲染</view>
  18. <view class="page-content">
  19. <scroll-view scroll-y>{{nodeSnip}}</scroll-view>
  20. <button type="primary" bindtap="renderNode">渲染Node</button>
  21. <block wx:if="{{renderedByNode}}">
  22. <rich-text nodes="{{nodes}}"></rich-text>
  23. </block>
  24. </view>
  25. </view>
  26. </view>
  27. <template is="foot" />
  28. </view>