Skip to content

Commit

Permalink
fix: svg builtin props should be camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh1990 committed Oct 9, 2021
1 parent 8f08177 commit 2561bf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/generateComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ const addAttribute = (domName: string, sub: XmlData['svg']['symbol'][number]['pa

for (const attributeName of Object.keys(sub.$)) {
if (attributeName === 'fill') {
template += `\n${whitespace(counter.baseIdent + 4)}${attributeName}={getIconColor(color, ${counter.colorIndex}, '${sub.$[attributeName]}')}`;
template += `\n${whitespace(counter.baseIdent + 4)}${camelCase(attributeName)}={getIconColor(color, ${counter.colorIndex}, '${sub.$[attributeName]}')}`;
counter.colorIndex += 1;
} else {
template += `\n${whitespace(counter.baseIdent + 4)}${attributeName}="${sub.$[attributeName]}"`;
template += `\n${whitespace(counter.baseIdent + 4)}${camelCase(attributeName)}="${sub.$[attributeName]}"`;
}
}
}
Expand Down

0 comments on commit 2561bf4

Please sign in to comment.