The Editormarkdown
APIgetValue
, getHTML
, getTOC
, setValue
yarn add the-editor
// or
npm i the-editor
const editor = new TheEditor(editorElement, options);
// options=
vue
// main.js
import 'the-editor/dist/the-editor.css'; //
// app.vue
<template>
<div ref="editor">
</template>
<script>
import { TheEditor } from 'the-editor'
export default {
mounted() {
const editor = new TheEditor(this.$refs.editor, {
value: '# Hello The Editor'
})
}
}
</script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/the-editor.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/the-editor.min.js"></script>
value | string | null | markdown |
gfm | boolean | true | GitHub Flavoured Markdown |
lineNumbers | boolean | true |
setValue | string | void | markdown |
getValue | string | markdown | |
getHTML | string | HTML | |
getTOC | Array<{ anchor: string; text: string; level: number; }> | TOC |