0.2.3 • Published 5 years ago
vue-next-tui-editor v0.2.3
vue-next-tui-editor
TOAST UI Editor for vue-next
Install
npm install vue-next-tui-editor --saveUsage
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>Props
| 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 .