パッケージの詳細

@wxml/parser

wxmlfile8.8kMIT0.4.0

A fast and tolerant wxml parser

wxml, parser, wechat, wexin

readme

@wxml/parser

npm version cnpm version CI Status GitHub license PRs Welcome Twitter Follow Author

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 !

更新履歴

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[0.4.0] - 2022-03-24

Added

  • Add new ast type WXAttributeInterpolation
  • Support parse WXInterpolation in WXAttribute

    Fixed

  • Fix WXScript parse error when follow WXText and WXInterpolation

[0.3.2] - 2022-01-15

Fixed

  • Add missing name property for WXScript node

[0.3.1] - 2022-01-15

  • No changing

[0.3.0] - 2021-11-15

Fixed

  • Fix multiline WXInterpolation parse error

[0.2.0] - 2021-10-22

Added

  • Add new ast type WXInterpolation
  • Add new script npm run puretest for better debugging
  • Add new property name for WXStartTag

Fixed

  • Fix WXScript parse error

[0.1.1] - 2021-10-20

Added

  • Add errors visitor key for parseForESLint

[0.1.0] - 2021-10-19

Added

  • Add more useful info on README.md

[0.0.1] - 2021-10-19

Added

  • Add based @wxml/parser feature support