mirror of
https://github.com/slidevjs/slidev.git
synced 2026-09-14 20:46:32 +08:00
9337e85757
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: _Kerman <kermanx@qq.com>
647 B
647 B
depends, tags, description
| depends | tags | description | |||
|---|---|---|---|---|---|
|
|
Set a maximum height for a code block and enable scrolling. |
Max Height
If the code doesn't fit into one slide, you use the maxHeight to set a fixed height and enable scrolling:
```ts {2|3|7|12}{maxHeight:'100px'}
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)
```
Note that you can use {*} as a placeholder of :
```ts {*}{maxHeight:'100px'}
// ...
```