Skip to content

Commit

Permalink
fix: hide default error toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo-shen committed Jan 1, 2024
1 parent e1f9bf7 commit 856da91
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
10 changes: 5 additions & 5 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
Console: (typeof import('./src/components/Console.vue'))['default'];
Header: (typeof import('./src/components/Header.vue'))['default'];
Message: (typeof import('./src/components/Message.vue'))['default'];
VanIcon: (typeof import('vant/es'))['Icon'];
VersionSelect: (typeof import('./src/components/VersionSelect.vue'))['default'];
Console: typeof import('./src/components/Console.vue')['default']
Header: typeof import('./src/components/Header.vue')['default']
Message: typeof import('./src/components/Message.vue')['default']
VanIcon: typeof import('vant/es')['Icon']
VersionSelect: typeof import('./src/components/VersionSelect.vue')['default']
}
}
28 changes: 12 additions & 16 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ function reload() {
defineExpose({ reload });
watchEffect(() => history.replaceState({}, '', store.serialize()));
const panelSize = ref(25);
const panelSize = ref(25)
const onResizePanel = (event: { size: number }[]) => {
panelSize.value = event[0].size;
};
panelSize.value = event[0].size
}
const panelConfig = computed(() => {
return {
output: {
Expand All @@ -65,27 +65,21 @@ const panelConfig = computed(() => {
},
console: {
size: 40,
},
};
});
}
}
})
</script>

<template>
<Header :config="config" :lang-configs="langConfigs" lang="zh-CN"> </Header>
<div class="van-repl">
<splitpanes class="default-theme" @resize="onResizePanel">
<pane
:size="panelConfig.output.size"
:min-size="panelConfig.output.minSize"
>
<pane :size="panelConfig.output.size" :min-size="panelConfig.output.minSize">
<div class="van-output">
<Preview ref="previewRef" :show="true" :ssr="false" />
</div>
</pane>
<pane
:size="panelConfig.editor.size"
:min-size="panelConfig.editor.minSize"
>
<pane :size="panelConfig.editor.size" :min-size="panelConfig.editor.minSize">
<div class="van-editor">
<Repl
ref="replRef"
Expand Down Expand Up @@ -135,9 +129,11 @@ body {
--color-branding: var(--van-doc-link-color) !important;
.right {
flex: 1;
.wrapper {
display: none;
}
}
.left,
.toggler {
.left, .toggler {
display: none;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@ class VantReplStore extends ReplStore {
const store = new VantReplStore({
serializedState: userFiles ? userFiles : utoa(JSON.stringify(_files)),
});

const SHOW_ERROR_KEY = 'repl_show_error'
localStorage.setItem(SHOW_ERROR_KEY, 'false');
export default store;

0 comments on commit 856da91

Please sign in to comment.