replace invalid characters in element names when creating variables (#516)

pull/7738/head
Conduitry 9 years ago
parent 682def4bda
commit 5f27bbdcde

@ -34,7 +34,7 @@ export default function visitElement ( generator, block, state, node ) {
return visitComponent( generator, block, state, node );
}
const name = block.getUniqueName( node.name );
const name = block.getUniqueName( node.name.replace( /[^a-zA-Z_$]/g, '_' ) );
const childState = Object.assign( {}, state, {
isTopLevel: false,

@ -0,0 +1,5 @@
export default {
html: `
<foo-bar>Hello</foo-bar>
`
}
Loading…
Cancel
Save