mirror of https://github.com/sveltejs/svelte
parent
985bf870d2
commit
0286dce026
@ -0,0 +1,5 @@
|
|||||||
|
<script context="module">
|
||||||
|
let num = 2;
|
||||||
|
let square;
|
||||||
|
$: square = num * num;
|
||||||
|
</script>
|
@ -0,0 +1,7 @@
|
|||||||
|
[{
|
||||||
|
"message": "$: has no effect in a module script",
|
||||||
|
"code": "module-script-reactive-declaration",
|
||||||
|
"start": { "line": 4, "column": 1, "character": 54 },
|
||||||
|
"end": { "line": 4, "column": 23, "character": 76 },
|
||||||
|
"pos": 54
|
||||||
|
}]
|
@ -0,0 +1,8 @@
|
|||||||
|
<script>
|
||||||
|
let num = 2;
|
||||||
|
$: square = num * num;
|
||||||
|
|
||||||
|
function myFunc() {
|
||||||
|
$: double = num * 2;
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,7 @@
|
|||||||
|
[{
|
||||||
|
"message": "$: has no effect outside of the top-level",
|
||||||
|
"code": "non-top-level-reactive-declaration",
|
||||||
|
"start": { "line": 6, "column": 2, "character": 71 },
|
||||||
|
"end": { "line": 6, "column": 22, "character": 91 },
|
||||||
|
"pos": 71
|
||||||
|
}]
|
Loading…
Reference in new issue