Skip to content

Commit

Permalink
fix(alita): 修复 TouchableHighlight 转化bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ykforerlang committed Jul 24, 2019
1 parent a703228 commit 9652e5d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
14 changes: 1 addition & 13 deletions src/tran/addEventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,7 @@ export default function touchableToView (ast) {


jsxElement.children.push(
t.jsxElement(
t.jsxOpeningElement(
t.jsxIdentifier('view'),
[
t.jsxAttribute(t.jsxIdentifier('diuu'), t.stringLiteral('thFabricate')),
t.jsxAttribute(t.jsxIdentifier('class'), t.stringLiteral('thFabricate')),
t.jsxAttribute(t.jsxIdentifier('style'), t.stringLiteral(`background-color: {{${diuu}underlayColor}}`))
]
),
t.jsxClosingElement(t.jsxIdentifier('view')),
[],
true
)
t.jsxText(`<view class="thFabricate" style="background-color: {{${diuu}underlayColor}}"/>`)
)


Expand Down
3 changes: 2 additions & 1 deletion src/tran/classNameHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default function classNameHandler (ast,info) {
&& path.node.name.name === 'view'
) {
const attris = path.node.attributes
const original = (attris.filter(item => item.type === 'JSXAttribute' && item.name.name === 'original'))[0].value.value
const origs = (attris.filter(item => item.type === 'JSXAttribute' && item.name.name === 'original'))
const original = origs[0].value.value

if (original === 'View'
|| original === 'AnimatedView'
Expand Down
4 changes: 0 additions & 4 deletions src/tran/geneAllTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ export default function(ast, info) {
const diuuAttr = getAttr(jsxOp, 'diuu')
const diuuKey = diuuAttr.value.value

if (diuuKey === 'thFabricate') {
// TouchableHighlight 产生的占位节点
return
}

const attr = path.node

Expand Down

0 comments on commit 9652e5d

Please sign in to comment.