Merge pull request #235 from PaulBGD/parse-numbers-correctly

Fix partial numbers being detected as numbers
pull/240/head
Rich Harris 8 years ago committed by GitHub
commit d420e75c14

@ -28,7 +28,7 @@ export default function addComponentAttributes ( generator, node, local ) {
if ( value.type === 'Text' ) {
// static attributes
const result = isNaN( parseFloat( value.data ) ) ? JSON.stringify( value.data ) : value.data;
const result = isNaN( value.data ) ? JSON.stringify( value.data ) : value.data;
local.staticAttributes.push({
name: attribute.name,
value: result

@ -0,0 +1,3 @@
export default {
html: '<p data-value="10px"></p>'
};

@ -0,0 +1,11 @@
<Component value="10px"/>
<script>
import Component from './Component.html';
export default {
components: {
Component
}
};
</script>
Loading…
Cancel
Save