Files
Anthony Fu 9337e85757 docs: use native sidebar (#1769)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: _Kerman <kermanx@qq.com>
2024-07-20 17:44:10 +02:00

647 B

depends, tags, description
depends tags description
guide/syntax#code-block
codeblock
layout
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'}
// ...
```