Skip to content

Commit ea9f35b

Browse files
committed
feat: custom label
1 parent 44be750 commit ea9f35b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/Repl.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export interface Props {
3636
showRuntimeWarning?: boolean
3737
}
3838
editorOptions?: {
39-
showErrorText?: string
39+
showErrorText?: string | false
40+
autoSaveText?: string | false
4041
monacoOptions?: monaco.editor.IStandaloneEditorConstructionOptions
4142
}
4243
}

src/editor/EditorContainer.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ watch(showMessage, () => {
4545

4646
<div class="editor-floating">
4747
<ToggleButton
48+
v-if="editorOptions?.showErrorText !== false"
4849
v-model="showMessage"
4950
:text="editorOptions?.showErrorText || 'Show Error'"
5051
/>
51-
<ToggleButton v-model="autoSave" text="Auto Save" bottom="48px" />
52+
<ToggleButton
53+
v-if="editorOptions?.autoSaveText !== false"
54+
v-model="autoSave"
55+
:text="editorOptions?.autoSaveText || 'Auto Save'"
56+
/>
5257
</div>
5358
</div>
5459
</template>

test/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const App = {
6868
// showCompileOutput: false,
6969
// showImportMap: false
7070
editorOptions: {
71+
autoSaveText: '💾',
7172
monacoOptions: {
7273
// wordWrap: 'on',
7374
},

0 commit comments

Comments
 (0)