allow spread props on elements with tests for static attributes

pull/1429/head
Rich Harris 7 years ago
parent e8a780676d
commit fa61d2570e

@ -2,7 +2,7 @@ import { Node } from '../interfaces';
export default function getStaticAttributeValue(node: Node, name: string) {
const attribute = node.attributes.find(
(attr: Node) => attr.name.toLowerCase() === name
(attr: Node) => attr.type === 'Attribute' && attr.name.toLowerCase() === name
);
if (!attribute) return null;

@ -0,0 +1,9 @@
export default {
data: {
props: {
'data-foo': 'bar'
}
},
html: `<input data-foo="bar">`
};
Loading…
Cancel
Save