mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
37 lines
899 B
Vue
37 lines
899 B
Vue
<template>
|
|
<div>
|
|
<div>
|
|
<comment-editor
|
|
:isSimple="globalState.isSimple"
|
|
:fieldName="fieldName"
|
|
@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 },
|
|
props: {
|
|
fieldName: String
|
|
},
|
|
setup() {
|
|
const globalState = inject('globalState');
|
|
const toggleEditorMode = () => {
|
|
globalState.isSimple = !globalState.isSimple;
|
|
localStorage.setItem('editorMode', globalState.isSimple ? 'simple' : 'rich');
|
|
};
|
|
|
|
return {
|
|
globalState,
|
|
toggleEditorMode,
|
|
};
|
|
}
|
|
});
|
|
</script>
|