对接烟台app的h5页面
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
juwei001 2e25ebaf91 初始化提交 1 year ago
..
lib 初始化提交 1 year ago
README.md 初始化提交 1 year ago
package.json 初始化提交 1 year ago

README.md

mini-html-parser2

安装

$ npm install mini-html-parser2 --save

使用

// page.js
const html = `<div>
<span>test</span>
<div>
    <span>table test</span>
    <table>
        <thead>
            <tr>
                <th>title</th>
                <th>title</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td colspan="2">yy</td>
                <td>xx</td>
                <td>xx</td>
                <td>xx</td>
            </tr>
        </tbody>
    </table>
</div>
</div>`
import parse from 'mini-html-parser2';

Page({
  data: {
    nodes: [],
  },
  onLoad() {
    parse(html, (err, nodes) => {
      if (!err) {
        this.setData({
          nodes,
        });
      }
    })
  },
})
<!-- page.axml -->
<rich-text nodes="{{nodes}}" />

运行测试

$ npm run build
$ npm test