mirror of https://github.com/sveltejs/svelte
Merge pull request #1 from baseballyama/gh-7937-baseballyama
add optimization of static <svelte:element> and fix a bugpull/7938/head
commit
19c07f577e
@ -1,3 +1,7 @@
|
|||||||
<svelte:element this="svg" xmlns="http://www.w3.org/2000/svg">
|
<script>
|
||||||
<svelte:element this="path" xmlns="http://www.w3.org/2000/svg"></svelte:element>
|
const tag = { svg: 'svg', path: 'path' };
|
||||||
</svelte:element>
|
</script>
|
||||||
|
|
||||||
|
<svelte:element this={tag.svg} xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<svelte:element this={tag.path} xmlns="http://www.w3.org/2000/svg" />
|
||||||
|
</svelte:element>
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<div>
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, target }) {
|
||||||
|
const p = target.querySelector('p');
|
||||||
|
|
||||||
|
assert.notEqual(p, undefined);
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
const p = 'p';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<svelte:element this={p} />
|
||||||
|
</div>
|
||||||
Loading…
Reference in new issue