fix component boolean attributes

pull/31/head
Rich-Harris 8 years ago
parent 8e96699044
commit 48ce1c9054

@ -9,7 +9,7 @@ export default function addComponentAttributes ( generator, node, local ) {
if ( attribute.type === 'Attribute' ) { if ( attribute.type === 'Attribute' ) {
if ( attribute.value === true ) { if ( attribute.value === true ) {
// attributes without values, e.g. <textarea readonly> // attributes without values, e.g. <textarea readonly>
local.data.push( `${attribute.name}: true` ); local.staticAttributes.push( `${attribute.name}: true` );
} }
else if ( attribute.value.length === 1 ) { else if ( attribute.value.length === 1 ) {

@ -0,0 +1,3 @@
export default {
html: `<p>x: true (boolean)</p>`
};

@ -0,0 +1,9 @@
<Foo x/>
<script>
import Foo from './Foo.html';
export default {
components: { Foo }
};
</script>
Loading…
Cancel
Save