mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
30 lines
764 B
Vue
30 lines
764 B
Vue
<template>
|
|
<div>
|
|
<div>
|
|
<comment-editor :isSimple="globalState.isSimple" @toggle="toggleEditorMode"></comment-editor>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { defineComponent, inject } from 'vue';
|
|
import CommentEditor from "../CommentEditor/component/CommentEditor.vue";
|
|
|
|
export default defineComponent({
|
|
name: "App",
|
|
components: { CommentEditor },
|
|
setup() {
|
|
const globalState = inject('globalState');
|
|
const toggleEditorMode = () => {
|
|
globalState.isSimple = !globalState.isSimple;
|
|
localStorage.setItem('editorMode', globalState.isSimple ? 'simple' : 'rich');
|
|
};
|
|
|
|
return {
|
|
globalState,
|
|
toggleEditorMode
|
|
};
|
|
}
|
|
});
|
|
</script>
|