Skip to content

Commit

Permalink
fix(taroize): 当 children 有空格的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche authored and luckyadam committed Nov 19, 2018
1 parent cd5b756 commit 3f58c90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/taroize/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function parsePage (path: NodePath<t.CallExpression>, returned: t.Expression, js
return t.classProperty(t.identifier(name), value.isFunctionExpression() ? t.arrowFunctionExpression(value.node.params, value.node.body) : value.node)
})

if (json) {
if (json && t.isObjectExpression(json)) {
classBody.push(
t.classProperty(
t.identifier('config'),
Expand Down
3 changes: 2 additions & 1 deletion packages/taroize/src/wxml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ function parseText (node: Text) {
const handlebarsRE = /\{\{((?:.|\n)+?)\}\}/g

function parseContent (content: string) {
content = content.trim()
if (!handlebarsRE.test(content)) {
return {
type: 'raw',
Expand Down Expand Up @@ -340,7 +341,7 @@ function handleAttrKey (key: string) {
let jsxKey = camelCase(key)

switch (jsxKey) {
case 'onClick':
case 'bindtap':
jsxKey = 'onClick'
break
case 'class':
Expand Down

0 comments on commit 3f58c90

Please sign in to comment.