JS

Page({

  /**
   * 页面的初始数据
   */
  data: {
    html: '<div class="div_class" style="line-height: 60px; color: red;">Hello World!</div><img src="/resource/test/test.jpg" style="width:200px;height:200px;"/>',    
  },
})

WXML

<rich-text nodes="{{html}}" data-data="{{html}}" bindtap="tap"></rich-text>

开发文档:

https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html

1 Comment

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注