File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Learn more: https://sli.dev/guide/syntax.html#monaco-editor
12
12
-->
13
13
14
14
<template >
15
- <iframe ref =" iframe" class =" text-base w-full" :style =" { height }" ></iframe >
15
+ <iframe ref =" iframe" class =" text-base w-full rounded " :style =" { height }" ></iframe >
16
16
</template >
17
17
18
18
<script setup lang="ts">
@@ -42,7 +42,8 @@ const props = defineProps({
42
42
43
43
const id = nanoid ()
44
44
const code = ref (decode (props .code ).trimEnd ())
45
- const height = computed (() => props .height === ' auto' ? ` ${code .value .split (/ \r ? \n / g ).length * 18 + 20 }px ` : props .height )
45
+ const lineHeight = + (getComputedStyle (document .body ).getPropertyValue (' --slidev-code-line-height' ) || ' 18' ).replace (' px' , ' ' ) || 18
46
+ const height = computed (() => props .height === ' auto' ? ` ${code .value .split (/ \r ? \n / g ).length * lineHeight + 20 }px ` : props .height )
46
47
const isReady = ref (false )
47
48
48
49
const iframe = ref <HTMLIFrameElement >()
You can’t perform that action at this time.
0 commit comments