refactor(editor): Improve linting for component and prop names (no-changelog) (#8169)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-12-28 09:49:58 +01:00
committed by GitHub
parent 639afcd7a5
commit 68cff4c59e
304 changed files with 3428 additions and 3516 deletions

View File

@@ -176,6 +176,27 @@ export default defineComponent({
},
},
mounted() {
htmlEditorEventBus.on('format-html', this.format);
let doc = this.modelValue;
if (this.modelValue === '' && this.rows > 0) {
doc = '\n'.repeat(this.rows - 1);
}
const state = EditorState.create({ doc, extensions: this.extensions });
this.editor = new EditorView({ parent: this.root(), state });
this.editorState = this.editor.state;
this.getHighlighter()?.addColor(this.editor, this.resolvableSegments);
},
beforeUnmount() {
htmlEditorEventBus.off('format-html', this.format);
},
methods: {
root() {
const rootRef = this.$refs.htmlEditor as HTMLDivElement | undefined;
@@ -264,27 +285,6 @@ export default defineComponent({
return highlighter;
},
},
mounted() {
htmlEditorEventBus.on('format-html', this.format);
let doc = this.modelValue;
if (this.modelValue === '' && this.rows > 0) {
doc = '\n'.repeat(this.rows - 1);
}
const state = EditorState.create({ doc, extensions: this.extensions });
this.editor = new EditorView({ parent: this.root(), state });
this.editorState = this.editor.state;
this.getHighlighter()?.addColor(this.editor, this.resolvableSegments);
},
beforeUnmount() {
htmlEditorEventBus.off('format-html', this.format);
},
});
</script>