@wxml/parser
v0.4.0
Published
A fast and tolerant wxml parser
Downloads
249
Readme
@wxml/parser
A fast and tolerant wxml parser
Installation
## npm
$ npm install @wxml/parser --save-dev
## yarn
$ yarn add @wxml/parser --dev
## cnpm (for china user)
$ cnpm install @wxml/parser --save-dev
Basic Usage
const { parse } = require("@wxml/parser");
const AST = parse(`
<view class="search-contianer">
<view class="search" style="height:{{navHeight}}px;padding-top:{{navTop}}px">
<view class="search-title" src="../../images/actLogo/ytlogo.png">
{{mallName}}
</view>
<input
placeholder-class="search-placeholder"
type="text"
placeholder="please enter keyword for search"
disabled
value="{{name}}"
bindinput="bindinput"
bindtap="goSearch">
</input>
</view>
</view>
`);
console.log("AST structure: ", AST);
Try Play Online
Open RunKit , and then happy coding !