File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export interface Props {
40
40
autoSaveText? : string | false
41
41
monacoOptions? : monaco .editor .IStandaloneEditorConstructionOptions
42
42
}
43
+ splitPaneOptions? : {
44
+ codeTogglerText? : string
45
+ outputTogglerText? : string
46
+ }
43
47
}
44
48
45
49
const autoSave = defineModel <boolean >({ default: true })
@@ -57,6 +61,7 @@ const props = withDefaults(defineProps<Props>(), {
57
61
layout: ' horizontal' ,
58
62
previewOptions : () => ({}),
59
63
editorOptions : () => ({}),
64
+ splitPaneOptions : () => ({}),
60
65
})
61
66
62
67
if (! props .editor ) {
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ const containerRef = useTemplateRef('container')
9
9
const previewRef = inject (injectKeyPreviewRef )!
10
10
11
11
// mobile only
12
- const { store } = inject (injectKeyProps )!
13
- const showOutput = computed (() => store .value .showOutput )
12
+ const { store, splitPaneOptions } = inject (injectKeyProps )!
14
13
15
14
const state = reactive ({
16
15
dragging: false ,
@@ -66,7 +65,7 @@ function changeViewSize() {
66
65
class =" split-pane"
67
66
:class =" {
68
67
dragging: state.dragging,
69
- 'show-output': showOutput,
68
+ 'show-output': store. showOutput,
70
69
vertical: isVertical,
71
70
}"
72
71
@mousemove =" dragMove"
@@ -90,8 +89,12 @@ function changeViewSize() {
90
89
<slot name =" right" />
91
90
</div >
92
91
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
+ }}
95
98
</button >
96
99
</div >
97
100
</template >
You can’t perform that action at this time.
0 commit comments