Skip to content

Commit

Permalink
fix(mini-runner): 修复快应用动态class不支持三目运算符问题 (NervJS#5556)
Browse files Browse the repository at this point in the history
  • Loading branch information
yechunxi committed Apr 26, 2020
1 parent eba7370 commit 2df0bec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/taro-mini-runner/src/quickapp/template/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const createAttrsCode = (attrs) => {
if (attrsKey.length) {
attrsCode = ' ' + attrsKey.map(name => {
if (!attrs[name] && ~ATTRS_NAME.indexOf(name)) {
return `${name}='true'`
return `${name}="true"`
}
return name === 'else' ? `${name}` : `${name}='${attrs[name]}'`
return name === 'else' ? `${name}` : `${name}="${attrs[name]}"`
}).join(' ')
}
return attrsCode
Expand All @@ -31,11 +31,11 @@ const createNodeCode = (name, children, content, attrsCode, $delete, url) => {
const walk = (node) => {
const attrsCode = createAttrsCode(node.attributes)
const nodeCode = createNodeCode(
node.name,
node.children,
node.content,
attrsCode,
node.$delete,
node.name,
node.children,
node.content,
attrsCode,
node.$delete,
node.url
)
return nodeCode
Expand Down

0 comments on commit 2df0bec

Please sign in to comment.