mirror of https://github.com/sveltejs/svelte
feat(runtime-browser): add support for <svelte:element this="contents"> to render children without wrapper
- Added handling in element block to treat "contents" as no-wrapper rendering - Added runtime-browser test for this behaviorpull/16392/head
parent
e01bd97bef
commit
32a29d9ee9
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add support for `<svelte:element this="contents">` to render children without wrapper element
|
@ -0,0 +1,12 @@
|
|||||||
|
import { test } from '../../assert';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client'],
|
||||||
|
async test({ assert, window }) {
|
||||||
|
await new Promise((r) => setTimeout(r, 1000));
|
||||||
|
assert.htmlEqual(
|
||||||
|
window.document.body.innerHTML,
|
||||||
|
`<main><strong>Hello</strong></main>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
let tag = 'contents';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:element this={tag}>
|
||||||
|
<strong>Hello</strong>
|
||||||
|
</svelte:element>
|
Loading…
Reference in new issue