Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

框架中如何引入其他小程序组件? #30

Open
262060984 opened this issue Dec 28, 2016 · 0 comments
Open

框架中如何引入其他小程序组件? #30

262060984 opened this issue Dec 28, 2016 · 0 comments

Comments

@262060984
Copy link

比如wxParsehttps://github.com/icindy/wxParse

一般wxParse使用方法如下

1. Copy文件夹wxParse
  • wxParse/
    -wxParse.js(必须存在)
    -html2json.js(必须存在)
    -htmlparser.js(必须存在)
    -showdown.js(必须存在)
    -wxDiscode.js(必须存在)
    -wxParse.wxml(必须存在)
    -wxParse.wxss(必须存在)
    -emojis(可选)

    1. 引入必要文件

//在使用的View中引入WxParse模块
var WxParse = require('../../wxParse/wxParse.js');

//在使用的Wxss中引入WxParse.css,可以在app.wxss
@import "/wxParse/wxParse.wxss";

3. 数据绑定

var article = '

我是HTML代码
';
/**

  • WxParse.wxParse(bindName , type, data, target,imagePadding)
  • 1.bindName绑定的数据名(必填)
  • 2.type可以为html或者md(必填)
  • 3.data为传入的具体数据(必填)
  • 4.target为Page对象,一般为this(必填)
  • 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
    */
    var that = this;
    WxParse.wxParse('article', 'html', article, that,5);

换到labrador框架下要怎么引入呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant