@leejim/wxml-parser

0.2.0 • Public • Published

npm npm NPM

wxml-parser

微信小程序 WXML Parser

安装

npm install -D @leejim/wxml-parser

使用

var WXMLParser = require('@leejim/wxml-parser');
var parser = new WXMLParser({
    onopentag(tagname, attrs, isSelfClosing) {},

    onclosetag(tagname) {},

    ontext(text) {},

    oncomment(cmt) {},

    ontemplate(tmp) {}
});
parser.write('<view>test</view>');

参数

onopentag

参数名 数据类型 描述
tagname string 标签名
attrs `Array<string AttrEntity>; interface AttrEntity { key: string; value: string } `
isSelfClosing boolean 是否自闭合标签

Readme

Keywords

Package Sidebar

Install

npm i @leejim/wxml-parser

Weekly Downloads

7,050

Version

0.2.0

License

MIT

Unpacked Size

14.3 kB

Total Files

10

Last publish

Collaborators

  • leejim