Skip to content

Commit d786626

Browse files
committed
fix: no default value for object props
1 parent 8eaf77e commit d786626

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/Repl.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,8 @@ const props = withDefaults(defineProps<Props>(), {
5252
clearConsole: true,
5353
layoutReverse: false,
5454
ssr: false,
55-
previewOptions: () => ({
56-
headHTML: '',
57-
bodyHTML: '',
58-
placeholderHTML: '',
59-
customCode: {
60-
importCode: '',
61-
useCode: '',
62-
},
63-
showRuntimeError: true,
64-
showRuntimeWarning: true,
65-
}),
6655
layout: 'horizontal',
56+
previewOptions: () => ({}),
6757
editorOptions: () => ({}),
6858
})
6959

src/output/Preview.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ defineExpose({ reload, container })
290290
class="iframe-container"
291291
:class="{ [theme]: previewTheme }"
292292
/>
293-
<Message :err="runtimeError && previewOptions?.showRuntimeError" />
293+
<Message :err="runtimeError && (previewOptions?.showRuntimeError ?? true)" />
294294
<Message
295-
v-if="!runtimeError && previewOptions?.showRuntimeWarning"
295+
v-if="!runtimeError && (previewOptions?.showRuntimeWarning ?? true)"
296296
:warn="runtimeWarning"
297297
/>
298298
</template>

0 commit comments

Comments
 (0)