mirror of https://github.com/sveltejs/svelte
parent
ef8a3f9c6b
commit
496501033c
@ -0,0 +1,21 @@
|
||||
export default {
|
||||
props: {
|
||||
size: 1
|
||||
},
|
||||
html: '<h1>This is h1 tag</h1>',
|
||||
|
||||
test({ assert, component, target }) {
|
||||
const h1 = target.firstChild;
|
||||
component.size = 2;
|
||||
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<h2>This is h2 tag</h2>
|
||||
`
|
||||
);
|
||||
|
||||
const h2 = target.firstChild;
|
||||
assert.notEqual(h1, h2);
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
export let size;
|
||||
</script>
|
||||
|
||||
<svelte:element this="{`h${size}`}">This is h{size} tag</svelte:element>
|
||||
Loading…
Reference in new issue