omi-mp - fix parse errro

This commit is contained in:
张磊 2018-12-05 10:14:13 +08:00
parent f016e05344
commit c3e6add1b7
3 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
{
"name": "omi-cli",
"version": "3.0.27",
"version": "3.0.28",
"description": "Create website with no build configuration. be friendly to [Omi](https://github.com/Tencent/omi) framework.",
"main": "bin/omi",
"engines": {

View File

@ -123,21 +123,21 @@ function _walk(node, currentIndex, children) {
let index = node.attr['wx:for-index'] || 'index'
let item = node.attr['wx:for-item'] || 'item'
let current = `${str}.map((${item},${index})=>{
return ${c}
return h('${map(node.tag)}',${stringify(
node.attr,
map(node.tag)
)},
${c}
)
})`
delete node.attr['wx:for']
delete node.attr['wx:for-items']
delete node.attr['wx:for-index']
delete node.attr['wx:for-item']
if (node.tag == 'block') {
result = `${ifCond} [${current}]`
} else {
result = `${ifCond}h('${map(node.tag)}',${stringify(
node.attr,
map(node.tag)
)},${current})`
}
result = `${ifCond} ${current}`
} else if (node.tag == 'block') {
result = isArray ? `${ifCond} [${c}]` : `${ifCond} ${c}`
} else {

View File

@ -123,21 +123,21 @@ function _walk(node, currentIndex, children) {
let index = node.attr['wx:for-index'] || 'index'
let item = node.attr['wx:for-item'] || 'item'
let current = `${str}.map((${item},${index})=>{
return ${c}
return h('${map(node.tag)}',${stringify(
node.attr,
map(node.tag)
)},
${c}
)
})`
delete node.attr['wx:for']
delete node.attr['wx:for-items']
delete node.attr['wx:for-index']
delete node.attr['wx:for-item']
if (node.tag == 'block') {
result = `${ifCond} [${current}]`
} else {
result = `${ifCond}h('${map(node.tag)}',${stringify(
node.attr,
map(node.tag)
)},${current})`
}
result = `${ifCond} ${current}`
} else if (node.tag == 'block') {
result = isArray ? `${ifCond} [${c}]` : `${ifCond} ${c}`
} else {