mirror of https://github.com/sveltejs/svelte
fix $$props reactive for slots (#5125)
parent
8a8177b897
commit
fc7e99e9f0
@ -0,0 +1 @@
|
||||
<slot props={$$props}/>
|
@ -0,0 +1,21 @@
|
||||
export default {
|
||||
html: `
|
||||
<h1>hi</h1>
|
||||
<button>Change</button>
|
||||
`,
|
||||
|
||||
async test({ assert, component, target, window }) {
|
||||
const btn = target.querySelector("button");
|
||||
const clickEvent = new window.MouseEvent("click");
|
||||
|
||||
await btn.dispatchEvent(clickEvent);
|
||||
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<h1>changed</h1>
|
||||
<button>Change</button>
|
||||
`
|
||||
);
|
||||
},
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import Comp from './Comp.svelte'
|
||||
let p = "hi"
|
||||
</script>
|
||||
|
||||
<Comp someprop={p} let:props>
|
||||
<h1>
|
||||
{props.someprop}
|
||||
</h1>
|
||||
</Comp>
|
||||
|
||||
<button on:click={()=> p = "changed"}>Change
|
||||
</button>
|
Loading…
Reference in new issue