demo.js 453 字节
Newer Older
1 2 3
const compiler = require('../lib')
const res = compiler.compile(
  `
fxy060608's avatar
fxy060608 已提交
4
<p slot="one">hello world</p>
5 6
    `, {
    resourcePath: '/User/fxy/Documents/test.wxml',
fxy060608's avatar
fxy060608 已提交
7 8 9 10 11 12
    isReservedTag: function (tag) {
      return true
    },
    getTagNamespace () {
      return false
    },
13
    mp: {
fxy060608's avatar
init v3  
fxy060608 已提交
14
      platform: 'app-plus'
15
    },
fxy060608's avatar
fxy060608 已提交
16
    service: true,
fxy060608's avatar
fxy060608 已提交
17
    view: true
18
  })
fxy060608's avatar
init v3  
fxy060608 已提交
19 20 21
console.log(require('util').inspect(res, {
  colors: true,
  depth: null
fxy060608's avatar
fxy060608 已提交
22
}))