Closed snowdream closed 5 months ago
I want to import tui editor into my project(vue3 + nuxt3),but failed.
errors: self is not defined
npm install --save @toast-ui/vue-editor
<template> <editor :initial-value="editorText" :options="defaultEditorOptions" height="500px" initial-edit-type="wysiwyg" preview-style="vertical" /> </template> <script setup lang="ts"> import { reactive, ref, onMounted, onUnmounted, nextTick } from 'vue' import '@toast-ui/editor/dist/toastui-editor.css' import { Editor } from '@toast-ui/vue-editor' const editorText = ref('This is initialValue.') const defaultEditorOptions = reactive({ minHeight: '200px', language: 'en-US', useCommandShortcut: true, usageStatistics: true, hideModeSwitch: false, toolbarItems: [ ['heading', 'bold', 'italic', 'strike'], ['hr', 'quote'], ['ul', 'ol', 'task', 'indent', 'outdent'], ['table', 'image', 'link'], ['code', 'codeblock'], ['scrollSync'] ] }) </script>
It works!
博主解决了么
https://github.com/snowdreamtech/vue-tui-editor
Describe the bug
I want to import tui editor into my project(vue3 + nuxt3),but failed.
errors: self is not defined
To Reproduce
Expected behavior
It works!
Screenshots
Desktop (please complete the following information):