omi-mp - fix parse errro
This commit is contained in:
parent
f016e05344
commit
c3e6add1b7
|
@ -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": {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue