0.2.3 • Published 4 years ago

vue-next-tui-editor v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

vue-next-tui-editor

TOAST UI Editor for vue-next

Install

npm install vue-next-tui-editor --save

Usage

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

NameTypeDefaultDescription
initialEditTypeString'markdown'Initial editor type (markdown, wysiwyg).
heightString'300px'This prop can control the height of the editor.
previewStyleString'vertical'Markdown editor's preview style (tab, vertical).

more props in defaultOptions.js .