提交 e5e2aea7 编写于 作者: 郝先瑞

refactor(WangEditor): 富文本编辑器TypeScript完善

上级 cdc74c75
......@@ -21,7 +21,7 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import {computed, onBeforeUnmount, reactive, toRefs} from 'vue'
import {Editor, Toolbar, getEditor, removeEditor} from '@wangeditor/editor-for-vue'
......@@ -55,7 +55,7 @@ const state = reactive({
uploadImage: {
// 自定义图片上传
// @link https://www.wangeditor.com/v5/guide/menu-config.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8A%9F%E8%83%BD
async customUpload(file, insertFn) {
async customUpload(file:any, insertFn:any) {
uploadFile(file).then(response => {
const url = response.data
insertFn(url)
......@@ -69,7 +69,7 @@ const state = reactive({
const {editorId, toolbarConfig, editorConfig,defaultHtml} = toRefs(state)
function handleChange(editor) {
function handleChange(editor:any) {
modelValue.value = editor.getHtml()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册