mirror of https://github.com/sveltejs/svelte
parent
b29e1e3a6f
commit
2329284d92
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
let props = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div {...props}></div>
|
@ -0,0 +1,6 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
ssrHtml: `<div></div>`,
|
||||||
|
html: `<div>set from component</div>`
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
import Child from './Child.svelte';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Child {@use (node) => node.textContent = 'set from component'} />
|
@ -0,0 +1,14 @@
|
|||||||
|
import { flushSync } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
ssrHtml: `<div></div><button>increment</button>`,
|
||||||
|
html: `<div>1</div><button>increment</button>`,
|
||||||
|
|
||||||
|
test: ({ assert, target }) => {
|
||||||
|
const btn = target.querySelector('button');
|
||||||
|
|
||||||
|
flushSync(() => btn?.click());
|
||||||
|
assert.htmlEqual(target.innerHTML, `<div>2</div><button>increment</button>`);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,6 @@
|
|||||||
|
<script>
|
||||||
|
let value = $state(1);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div {@use (node) => node.textContent = value}></div>
|
||||||
|
<button onclick={() => value += 1}>increment</button>
|
@ -0,0 +1,6 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
ssrHtml: `<div></div>`,
|
||||||
|
html: `<div>DIV</div>`
|
||||||
|
});
|
@ -0,0 +1 @@
|
|||||||
|
<svelte:element this={'div'} {@use (node) => node.textContent = node.nodeName}></svelte:element>
|
Loading…
Reference in new issue