mirror of https://github.com/sveltejs/svelte
parent
7e0a81d102
commit
152fe5019b
@ -1,11 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
class Foo {
|
class Foo {
|
||||||
a = $state();
|
a = $state(0);
|
||||||
#b = $state();
|
#b = $state();
|
||||||
|
foo = $derived({ bar: this.a * 2 });
|
||||||
|
bar = $derived({ baz: this.foo });
|
||||||
constructor() {
|
constructor() {
|
||||||
this.a = 1;
|
this.a = 1;
|
||||||
this.#b = 2;
|
this.#b = 2;
|
||||||
|
this.foo.bar = 3;
|
||||||
|
this.bar = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in new issue