TOAST UI Editor for vue-next
npm install vue-next-tui-editor --save
First add TuiEditor
to the Vue instance.
// main.js
import { createApp } from 'vue';
import { TuiEditor } from 'vue-next-tui-editor';
import App from './App.vue';
const app = createApp(App);
app.component('tui-editor', TuiEditor)
And implement <tui-editor />
in your template.
<template>
<div>
<tui-editor
v-model="editorValue"
:height="height"
:hideModeSwitch="true"
></tui-editor>
</div>
</template>
<script>
import { ref } from "vue";
export default {
setup(){
const editorValue = ref('Hello world!')
const height = ref('300px')
return { editorValue, height }
},
};
</script>
Name | Type | Default | Description |
---|---|---|---|
initialEditType | String | 'markdown' | Initial editor type (markdown, wysiwyg). |
height | String | '300px' | This prop can control the height of the editor. |
previewStyle | String | 'vertical' | Markdown editor's preview style (tab, vertical). |
more props in defaultOptions.js .