1.0.6 • Published 4 years ago
@tripmini/wxparse v1.0.6
组件说明
富文本解析wxParse
使用方法简介
- json文件中添加wxParse-component组件
{
"usingComponents": {
"wxParse-component": "@tencent/wxparse/wxParse/wxParse-component/wxParse-component"
}
}
- js文件中调用wxParse
必填bindName-->解析后数据的名字 必填type-->目前支持'html'和'markdown' 必填data-->要解析的数据 必填target-->Page对象,一般为this 非必填imagePadding-->图片自适应时左右的单一padding,默认为0
import wxParser from '@tencent/wxparse/wxParse/wxParse';
wxParser.wxParse(bindName, type, data, target, imagePadding);
- wxml文件中使用wxParse-component组件
<block wx:for="{{ bindName.nodes }}" wx:key="index">
<wxParse-component item="{{ item }}" />
</block>