File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export interface Props {
4040 autoSaveText? : string | false
4141 monacoOptions? : monaco .editor .IStandaloneEditorConstructionOptions
4242 }
43+ splitPaneOptions? : {
44+ codeTogglerText? : string
45+ outputTogglerText? : string
46+ }
4347}
4448
4549const autoSave = defineModel <boolean >({ default: true })
@@ -57,6 +61,7 @@ const props = withDefaults(defineProps<Props>(), {
5761 layout: ' horizontal' ,
5862 previewOptions : () => ({}),
5963 editorOptions : () => ({}),
64+ splitPaneOptions : () => ({}),
6065})
6166
6267if (! props .editor ) {
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ const containerRef = useTemplateRef('container')
99const previewRef = inject (injectKeyPreviewRef )!
1010
1111// mobile only
12- const { store } = inject (injectKeyProps )!
13- const showOutput = computed (() => store .value .showOutput )
12+ const { store, splitPaneOptions } = inject (injectKeyProps )!
1413
1514const state = reactive ({
1615 dragging: false ,
@@ -66,7 +65,7 @@ function changeViewSize() {
6665 class =" split-pane"
6766 :class =" {
6867 dragging: state.dragging,
69- 'show-output': showOutput,
68+ 'show-output': store. showOutput,
7069 vertical: isVertical,
7170 }"
7271 @mousemove =" dragMove"
@@ -90,8 +89,12 @@ function changeViewSize() {
9089 <slot name =" right" />
9190 </div >
9291
93- <button class =" toggler" @click =" showOutput = !showOutput" >
94- {{ showOutput ? '< Code' : 'Output >' }}
92+ <button class =" toggler" @click =" store.showOutput = !store.showOutput" >
93+ {{
94+ store.showOutput
95+ ? splitPaneOptions?.codeTogglerText || '< Code'
96+ : splitPaneOptions?.outputTogglerText || 'Output >'
97+ }}
9598 </button >
9699 </div >
97100</template >
You can’t perform that action at this time.
0 commit comments