限制字数为100 下面贴出了我的代码 <template> <!-- 工具栏 --> <Toolbar style="border-bottom: 1px solid #ccc" :editor="editor" :default-config="toolbarConfig" /> <!-- 编辑器 --> <Editor id="editorContainer" v-model="html" :mode="'simple'" style="height: 400px; overflow-y...
1,vue中安装wangEditor 使用的npm安装 npm install wangeditor --save 2,创建公用组件 在components中创建wangEnduit文件夹 组件内容为<template lang="html"> </template> import E from 'wangeditor' export default { name: 'editoritem', data() { return { // uploadPath, editor: null, info_...
2-2、封装 wangEditor 组件(wangEditor.vue) src / components / wangEditor / fileMenu.js /** * editor: wangEditor 的实例 * editorSelector: wangEditor 挂载点的节点 * options: 一些配置 */ import uploadFile from "./uploadFile"; import vue from "vue"; export default (editor, editorSelector, opt...
wangEditor。vue 子组件 <template> <Toolbar class="wang-header" :editor="editorRef" :default-config="toolbarConfig" :mode="mode" /> <!-- v-if="uploa…
editor.config.uploadImgShowBase64 = false; //服务器接收的上传图片的属性名 this.editor.config.uploadFileName = "file"; //服务器上传图片的接口地址 this.editor.config.uploadImgServer = `http://localhost:3000/upload`; // 默认限制图片大小是 5M ,可以自己修改。 this.editor.config.uploadImgMaxSize...
seteditor() { this.editor = new E(this.$refs.editor); // this.editor.customConfig.uploadImgShowBase64 = true; // 使用 base64 保存图片 this.editor.customConfig.uploadImgServer = "http://pai.hoer.top/api/daily/upload"; this.editor.customConfig.uploadFileName = "Filedata"; ...
1、创建一个Vue组件 //视频上传以上为图片上传配置,以下为视频上传配置。 <template></template>import { mapGetters } from 'vuex' import E from 'wangeditor' import { getToken } from '@/utils/auth' import log from '@/views/system/timing/log' export default { name: 'Editor', model: { prop:...
consthttp=axios.create({baseURL:process.env.VUE_APP_API_URL,timeout:1000*180,withCredentials:true,}) React中的代码 MyEditor.tsx constMyEditorRef:any=useRef(null);useImperativeHandle(ref,()=>{return{};});// 模拟 ajax 请求,异步设置 htmluseEffect(()=>{setHtml(html);},[html]);useEffect(...
vue中安装wangEditor 创建公用组件 在components中创建wangEnduit文件夹 组件wangEnduit为 <template lang="html"> </template> import E from 'wangeditor' export default { data() { return { // uploadPath, editor: null, info_: null } },...
1、vue中安装wangEditor npm install wangeditor --save 2、创建公用组件 在components中创建wangEnduit文件夹,组件内容为:<templatelang="html"></template>import E from 'wangeditor' export default { name: 'editoritem', data() { return { // uploadPath, editor: null, info_: null } }, model:...