Skip to content

Commit

Permalink
docs: at option in line highlightning (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechWatching committed Nov 9, 2023
1 parent 285da45 commit cbaf809
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions guide/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ function add(

This will first highlight `a: Ref<number> | number` and `b: Ref<number> | number`, and then `return computed(() => unref(a) + unref(b))` after one click, and lastly, the whole block. Learn more in the [clicks animations guide](/guide/animations).

You can start the highlight at a specific click:

~~~ts
//```ts {2-3|5|all} {at:0}
function add(
a: Ref<number> | number,
b: Ref<number> | number
) {
return computed(() => unref(a) + unref(b))
}
//```
~~~

This is especially useful when you need to sync different animations (when using `two-cols` layout and list animation for instance).

To skip highlighting any lines, you can set the line number to `0`. For example

~~~ts {0}
Expand Down

0 comments on commit cbaf809

Please sign in to comment.