Skip to content

Commit

Permalink
[Element][DOM] Set classDependencies before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
umanghome committed Jul 13, 2019
1 parent c3bcee8 commit a61f594
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/compile/render-dom/wrappers/Element/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,19 @@ export default class ElementWrapper extends Wrapper {
}

addAttributes(block: Block) {
// Get all the class dependencies first
this.attributes.forEach((attribute: Attribute) => {
if (attribute.node.name === 'class' && attribute.node.isDynamic) {
this.classDependencies.push(...attribute.node.dependencies);
}
});

if (this.node.attributes.find(attr => attr.type === 'Spread')) {
this.addSpreadAttributes(block);
return;
}

this.attributes.forEach((attribute: Attribute) => {
if (attribute.node.name === 'class' && attribute.node.isDynamic) {
this.classDependencies.push(...attribute.node.dependencies);
}
attribute.render(block);
});
}
Expand Down Expand Up @@ -934,4 +938,4 @@ export default class ElementWrapper extends Wrapper {
);
}
}
}
}

0 comments on commit a61f594

Please sign in to comment.