Skip to content

Commit

Permalink
fix: no default value for object props
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 22, 2024
1 parent 8eaf77e commit d786626
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions src/Repl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,8 @@ const props = withDefaults(defineProps<Props>(), {
clearConsole: true,
layoutReverse: false,
ssr: false,
previewOptions: () => ({
headHTML: '',
bodyHTML: '',
placeholderHTML: '',
customCode: {
importCode: '',
useCode: '',
},
showRuntimeError: true,
showRuntimeWarning: true,
}),
layout: 'horizontal',
previewOptions: () => ({}),
editorOptions: () => ({}),
})
Expand Down
4 changes: 2 additions & 2 deletions src/output/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ defineExpose({ reload, container })
class="iframe-container"
:class="{ [theme]: previewTheme }"
/>
<Message :err="runtimeError && previewOptions?.showRuntimeError" />
<Message :err="runtimeError && (previewOptions?.showRuntimeError ?? true)" />
<Message
v-if="!runtimeError && previewOptions?.showRuntimeWarning"
v-if="!runtimeError && (previewOptions?.showRuntimeWarning ?? true)"
:warn="runtimeWarning"
/>
</template>
Expand Down

0 comments on commit d786626

Please sign in to comment.