wechat-wxparse 使用

github地址

https://github.com/ianzhi/wxParse

引入插件

{
  "usingComponents": {
    "wxparse": "/components/wxparse/wxparse"
  }
}

页面html

<view class="content">
      <wxparse data="{{outData}}" type="html" padding="5"></wxparse>
</view>

css

.content {
     710rpx;
    height: auto;
    padding-top: 25rpx;
    padding-bottom: 10rpx;
    margin: 0 auto;
    image {
         710rpx;
        height: auto;
    }
}

js

import Storage from "../../common/auth/Storage";
import { initNoPage } from "../../common/requestData";
import tips from "../../common/tips";
import request from "../../common/request";
const app = getApp();


Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    initNoPage(this, [{ api: "getIntro", inData: {}, outDataName: "outData" }]);
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})

原文地址:https://www.cnblogs.com/jiqing9006/p/12915678.html