Skip to content

Commit 9fe6a9b

Browse files
committed
feat(EditorContainer): support hidden sfc of file-selector
1 parent 74245cb commit 9fe6a9b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/editor/EditorContainer.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ import type { EditorComponentType } from './types'
99
1010
const SHOW_ERROR_KEY = 'repl_show_error'
1111
12-
const props = defineProps<{
12+
interface Props {
1313
editorComponent: EditorComponentType
14-
}>()
14+
hideFileSelector?: Boolean
15+
}
16+
17+
// const props = defineProps<{
18+
// editorComponent: EditorComponentType
19+
// }>()
20+
21+
const props = withDefaults(defineProps<Props>(), {
22+
hideFileSelector: () => false,
23+
})
1524
1625
const store = inject('store') as Store
1726
const showMessage = ref(getItem())
@@ -35,7 +44,7 @@ watch(showMessage, () => {
3544
</script>
3645

3746
<template>
38-
<FileSelector />
47+
<FileSelector v-if="!hideFileSelector" />
3948
<div class="editor-container">
4049
<props.editorComponent
4150
@change="onChange"

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export { ReplStore, File, defaultMainFile, importMapFile } from './store'
44
export { compileFile } from './transform'
55
export { default as CodeMirrorEditor } from './editor/CodeMirrorEditor.vue'
66
export { default as MonacoEditor } from './editor/MonacoEditor.vue'
7+
export { default as EditorContainer } from './editor/EditorContainer.vue'
78
export type { Props as ReplProps } from './Repl.vue'
89
export type { Store, StoreOptions, SFCOptions, StoreState } from './store'
910
export type { OutputModes } from './output/types'

0 commit comments

Comments
 (0)