mirror of https://github.com/sveltejs/svelte
[fix] don't run binding init unnecessarily (#7981)
parent
d2ff2aee4f
commit
4c5469b1ee
@ -0,0 +1,3 @@
|
|||||||
|
<script>
|
||||||
|
export let tab;
|
||||||
|
</script>
|
@ -0,0 +1,7 @@
|
|||||||
|
export default {
|
||||||
|
async test({ assert, target }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<p>0</p>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,17 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
import Tab from "./Tab.svelte";
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
const { set, subscribe } = writable({ id: 1, name: "tab1" });
|
||||||
|
const tab = {
|
||||||
|
set(value) {
|
||||||
|
i++;
|
||||||
|
set(value);
|
||||||
|
},
|
||||||
|
subscribe,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Tab bind:tab={$tab} />
|
||||||
|
<p>{i}</p>
|
Loading…
Reference in new issue