docs: clarify {@debug} vs $inspect usage

Add cross-links so readers can tell template {@debug} apart from the
$inspect rune used in script.

Fixes #15498
pull/18577/head
Hashim Khan 2 months ago
parent 2bace308e3
commit 34a15f3203

@ -62,3 +62,7 @@ This rune, added in 5.14, causes the surrounding function to be _traced_ in deve
``` ```
`$inspect.trace` takes an optional first argument which will be used as the label. `$inspect.trace` takes an optional first argument which will be used as the label.
## $inspect vs {@debug ...}
`$inspect` is used inside a `<script>` block. To debug values from the template markup itself, use the [`{@debug ...}`](@debug) tag.

@ -33,3 +33,7 @@ The `{@debug ...}` tag offers an alternative to `console.log(...)`. It logs the
The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when _any_ state changes, as opposed to the specified variables. The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when _any_ state changes, as opposed to the specified variables.
## {@debug ...} vs $inspect
`{@debug ...}` is used in the template. To log reactive values from inside a `<script>` block instead, use [`$inspect`]($inspect).

Loading…
Cancel
Save