# wxml-to-uni

> 微信小程序wxml模板转uni-app模板

Latest version **0.0.3** (published 2021-08-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install wxml-to-uni
pnpm add wxml-to-uni
yarn add wxml-to-uni
bun add wxml-to-uni
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-08-31 |
| First published | 2021-07-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | zhongjiajian |
| Maintainers | zhongjiajian |
| Keywords | wxml, 微信小程序, miniprogram, uni-app, wxml to uni, wxml converter, 模板 |

## Links

- npm: https://www.npmjs.com/package/wxml-to-uni
- Repository: https://github.com/zhongjiajian/wxml-to-uni
- Homepage: https://github.com/zhongjiajian/wxml-to-uni#readme
- Issues: https://github.com/zhongjiajian/wxml-to-uni/issues
- npm.io page: https://npm.io/package/wxml-to-uni

## Dependencies (1)

- [himalaya](https://npm.io/package/himalaya.md) ^1.1.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2021-08-31
- 0.0.2 — 2021-07-08
- 0.0.1 — 2021-07-08

## README

## 微信小程序wxml模板转uni-app模板

## Usage
```
npm install -D wxml-to-uni
```

```
const fs = require('fs')
const path = require('path')
const wtu = require('wxml-to-uni')

const inputPath = path.resolve(__dirname, 'input.wxml')
const wxml = fs.readFileSync(inputPath, {
  encoding: 'utf8'
})
const uniml = wtu(wxml)
const outputPath = path.resolve(__dirname, 'output.xml')
fs.writeFile(outputPath, uniml, err => {
  if (err) console.log(err);
})
```
## --example--
### input.wxml
```
<view wx:if="{{isShow}}">
</view>
<view wx:elif="{{isShow}}">
</view>
<view wx:else>
</view>

<myInput
  model:value="{{inputValue}}"
  bindchange1="bindchange1"
  bind:change2="bindchange2"
  catchchange1="catchchange1"
  catch:change2="catchchange2"
/>

<view capture-bind:tap="captureBindTap" capture-catch:tap="captureCatchTap">capture</view>

<view wx:for="{{list}}" wx:key="id">
  <view
    wx:for="{{item.children}}"
    wx:key="*this"
    wx:for-item="ele"
    wx:for-index="eleIndex"
  >
    {{eleIndex}}:{{ele}}
  </view>
</view>

<view class='{{dataInfo.status == 2?"mulBtns":""}}'></view>

<view class="{{dataInfo.status == 2?'mulBtns':''}}"></view>

<view
  class='orderDetail hasFixedFooter {{dataInfo.status == 2?"mulBtns":""}}'
  style="font-size:16px;color:{{color}};"
  data-flag="flag"
>content
</view>

<button class="{{type}} {{disabled?'disabled':''}}">{{btnText}}</button>

```


### output.xml
```
<view v-if='isShow'>
</view>
<view v-else-if='isShow'>
</view>
<view wx:else>
</view>

<myinput 
  :value.sync='inputValue' 
  @change1='bindchange1' 
  @change2='bindchange2' 
  catchchange1='catchchange1' 
  catch:change2='catchchange2'
></myinput>

<view @tap.captrue='captureBindTap' @tap.captrue.stop='captureCatchTap'>capture</view>

<view v-for='(item,index) in list' :key='item.id'>
  <view v-for='(ele,eleIndex) in item.children' :key='ele'>
    {{eleIndex}}:{{ele}}
  </view>
</view>

<view :class='dataInfo.status == 2?"mulBtns":""'></view>

<view :class="dataInfo.status == 2?'mulBtns':''"></view>

<view 
  :class="'orderDetail hasFixedFooter ' + (dataInfo.status == 2?'mulBtns':'')" 
  :style="'font-size:16px;color:' + (color) + ';'" 
  data-flag='flag'
>content</view>

<button :class="(type) + ' ' + (disabled?'disabled':'')">{{btnText}}</button>

```

---
_Source: https://npm.io/package/wxml-to-uni · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
