小程序富文本rich-text

1,772 阅读1分钟

wxml

<view>
    <rich-text  nodes="{{html}}"></rich-text>
</view>

js

Page({
  data: {
    html:''
  },
  onLoad: function (options) {
    var that = this
    that.setData({
     html: '<p class="colorred">上九天揽月下五湖捉鳖</p>'
    })
  },
 
})

css

.colorred{
  text-indent:2em
}

使用方法很简单 希望对大家有所帮助

喜欢下方小程序,需要源码的,添加微信私聊小编.