mirror of https://github.com/sveltejs/svelte
error on expression scope store (#5079)
parent
e6026fe6f5
commit
f739b4772a
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
error: `Stores must be declared at the top level of the component (this may change in a future version of Svelte)`
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
import { writable } from 'svelte/store';
|
||||
const store = writable();
|
||||
|
||||
function foo() {
|
||||
let store = 1;
|
||||
$store = 2;
|
||||
}
|
||||
</script>
|
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
error: `Stores must be declared at the top level of the component (this may change in a future version of Svelte)`
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
import { writable } from 'svelte/store';
|
||||
const store = writable();
|
||||
</script>
|
||||
|
||||
<button
|
||||
on:click={(store) => {
|
||||
$store = Math.random();
|
||||
}} />
|
Loading…
Reference in new issue