UNPKG

@alicd/templateparser

Version:

walle template parser

23 lines (16 loc) 641 B
## TemplateParser > 用于 walle 的模板解析模块 * `render(template, cmps)` 方法 * template: String 要解析的模板 * cmps: react组件集合,[wallecomponents](http://gitlab.alibaba-inc.com/wallegroup/wallecomponents) 执行 render 之后,实例会有以下属性供使用 * tagsNumber 标签数量 * logicJSON 将模板语法解析后的json对象 举例 ```javascript import TemplateParser from '@alicd/templateparser'; const templateParser = new TemplateParser(); templateParser.render('<div>模板</div>', this.rCmp); console.info(templateParser.tagsNumber); console.info(templateParser.logicJSON); ```