Skip to content

Commit

Permalink
docs: added description and example usage for auto scroll feature (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolodev authored Jul 21, 2022
1 parent 8b430ee commit 8c6068a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion guide/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ 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).

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

~~~ts {0}
Expand All @@ -115,7 +117,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).
If the code doesn't fit into one slide, you can pass an extra maxHeight option which will set fixed height
and enable scrolling

~~~ts {2|3|7|12}
//```ts {2|3|7|12} {maxHeight:'100'}
function add(
a: Ref<number> | number,
b: Ref<number> | number
) {
return computed(() => unref(a) + unref(b))
}
/// ...as many lines as you want
const c = add(1, 2)
//```
~~~

### Monaco Editor

Expand Down

0 comments on commit 8c6068a

Please sign in to comment.