效果如图:
首先需要先下载相应文件,下载地址:https://pan.baidu.com/s/1mSjZTa4YlKCmMCG8Sow_fg
然后,下载解压之后,放入项目中,如图:
wxml代码:
<import src="../../wxParse/wxParse.wxml"/>
<view style=\'text-align:center;\'>放置引入的H5页面</view>
<view class=\'content\' style=\'height:100%;width:84%;padding:2% 3%;margin-left:5%;border:1px solid red;\'>
<template is="wxParse" data="{{wxParseData:htmltxt.nodes}}"/>
</view>
js代码:
onLoad: function (options) {
var _this = this;
var WxParse = require(\'../../wxParse/wxParse.js\');
var text = "<view>this is insertText</view>";
WxParse.wxParse(\'htmltxt\', \'html\', text, _this,5);
},