fix: parse tango variables in view file

This commit is contained in:
wwsun
2023-11-27 13:55:53 +08:00
parent 588861f649
commit d91763379c
+6 -1
View File
@@ -1262,7 +1262,12 @@ export function traverseViewFile(ast: t.File, idGenerator: IdGenerator) {
MemberExpression(path) {
const variable = node2value(path.node, false);
if (isTangoVariable(variable) && !variables.includes(variable)) {
const parentNode = path.parentPath.node;
if (
!t.isMemberExpression(parentNode) &&
isTangoVariable(variable) &&
!variables.includes(variable)
) {
variables.push(variable);
}
},