新增分销配置
This commit is contained in:
@@ -11,24 +11,15 @@
|
||||
<template>
|
||||
<div style="z-index: 999; border: 1px solid #ccc">
|
||||
<!-- 工具栏 -->
|
||||
<Toolbar
|
||||
:editor="editorRef"
|
||||
mode="simple"
|
||||
:default-config="toolbarConfig"
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
/>
|
||||
<Toolbar :editor="editorRef" mode="simple" :default-config="toolbarConfig" style="border-bottom: 1px solid #ccc" />
|
||||
<!-- 编辑器 -->
|
||||
<Editor
|
||||
v-model="modelValue"
|
||||
:style="{ height: height, overflowY: 'hidden' }"
|
||||
:default-config="editorConfig"
|
||||
mode="simple"
|
||||
@on-created="handleCreated"
|
||||
/>
|
||||
<Editor v-model="modelValue" :style="{ height: height, overflowY: 'hidden' }" :default-config="editorConfig"
|
||||
mode="simple" @on-created="handleCreated" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import dayjs from "dayjs";
|
||||
import "@wangeditor-next/editor/dist/css/style.css";
|
||||
import { Toolbar, Editor } from "@wangeditor-next/editor-for-vue";
|
||||
import { IToolbarConfig, IEditorConfig } from "@wangeditor-next/editor";
|
||||
@@ -37,7 +28,7 @@ import { IToolbarConfig, IEditorConfig } from "@wangeditor-next/editor";
|
||||
import FileAPI from "@/api/file";
|
||||
|
||||
// 上传图片回调函数类型
|
||||
type InsertFnType = (url: string, alt: string, href: string) => void;
|
||||
type InsertFnType = (url: any, alt: any, href: any) => void;
|
||||
|
||||
defineProps({
|
||||
height: {
|
||||
@@ -68,8 +59,11 @@ const editorConfig = ref<Partial<IEditorConfig>>({
|
||||
customUpload(file: File, insertFn: InsertFnType) {
|
||||
// 上传图片
|
||||
FileAPI.uploadFile(file).then((res) => {
|
||||
|
||||
console.log('上传图', res);
|
||||
|
||||
// 插入图片
|
||||
insertFn(res.url, res.name, res.url);
|
||||
insertFn(res, dayjs().valueOf(), res);
|
||||
});
|
||||
},
|
||||
} as any,
|
||||
|
||||
Reference in New Issue
Block a user