mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
24 lines
710 B
TypeScript
24 lines
710 B
TypeScript
import App from "../../vuejs/CommentEditor/App.vue"
|
|
import { createApp, reactive } from "vue";
|
|
|
|
const ckeditorFields: NodeListOf<HTMLTextAreaElement> =
|
|
document.querySelectorAll("[id^='comment-app']");
|
|
|
|
const globalState = reactive({
|
|
isSimple: localStorage.getItem('editorMode') === 'simple'
|
|
});
|
|
window.addEventListener('storage', () => {
|
|
globalState.isSimple = localStorage.getItem('editorMode') === 'simple';
|
|
});
|
|
|
|
ckeditorFields.forEach((field: HTMLTextAreaElement): void => {
|
|
const app = createApp(App,{
|
|
fieldName: field.dataset.fieldName,
|
|
template: `<app></app>`
|
|
});
|
|
|
|
app.provide('globalState', globalState)
|
|
.component("app", App)
|
|
.mount(field);
|
|
});
|