Blogger Information
Blog 29
fans 0
comment 0
visits 34520
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
小程序富文本内容使用Parser进行转html
徐郭鹏的博客
Original
1366 people have browsed it

1.下载Parser文件夹至小程序目录 (卡乐哥小程序使用了)
2.在需要引用的页面的json文件中添加
{
“usingComponents”: {
“Parser”:”../Parser/index”
}
}
3.在js文件里面添加
this.setData({
html:’your html’
})
parser:function(e){
console.log(e);
}

  1. 在wxml文件里面展示的地方添加

    <Parser html="{{html}}" bindparser="parser" />

之前用的是wxParse,但是在使用过程中,对html标签的不兼容 太多,导致进行了更换。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post