vue 一个页面使用多个wangEditor并删除_wangeditor删除配置项-程序员宅基地

技术标签: vue  

<template lang="html">
  <div class="editor">
    <div ref="toolbar" class="toolbar">
    </div>
    <div ref="editor" class="text">
    </div>
    <el-button @click="deleteStudent">删除</el-button>
  </div>
</template>

<script>
  import E from 'wangeditor'
  import emojiJSON from './emoji.json'
  export default {
    name: 'editoritem',
    data() {
      return {
        // uploadPath,
        editor: null,
        info_: null,
        emojiList: emojiJSON
      }
    },
    model: {
      prop: 'value',
      event: 'change'
    },
    props: {
      index: {
        type: Number,
        required: true
      },
      value: {
        type: String,
        default: ''
      },
      isClear: {
        type: Boolean,
        default: false
      }
    },
    watch: {
      isClear(val) {
        // 触发清除文本域内容
        if (val) {
          this.editor.txt.clear()
          this.info_ = null
        }
      },
      value: function(value) {
        if (value !== this.editor.txt.html()) {
          this.editor.txt.html(this.value)
        }
      }
      //value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值
    },
    mounted() {
      this.seteditor()
      this.editor.txt.html(this.value)
    },
    methods: {
      seteditor() {
        // http://192.168.2.125:8080/admin/storage/create
        this.editor = new E(this.$refs.toolbar, this.$refs.editor)
        this.editor.customConfig.emotions = [
          {
            title: '默认',
            type: 'image',
            content: this.emojiList
          }
        ]
        this.editor.customConfig.uploadImgShowBase64 = false // base 64 存储图片
        this.editor.customConfig.uploadImgServer = 'http://otp.cdinfotech.top/file/upload_images'// 配置服务器端地址
        this.editor.customConfig.uploadImgHeaders = { }// 自定义 header
        this.editor.customConfig.uploadFileName = 'file' // 后端接受上传文件的参数名
        this.editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024 // 将图片大小限制为 2M
        this.editor.customConfig.uploadImgMaxLength = 6 // 限制一次最多上传 3 张图片
        this.editor.customConfig.uploadImgTimeout = 3 * 60 * 1000 // 设置超时时间

        // 配置菜单
        this.editor.customConfig.menus = [
          'emoticon', // 表情
        ]
        this.editor.customConfig.onchange = (html) => {
          this.info_ = html // 绑定当前逐渐地值
          this.$emit('change', this.info_) // 将内容同步到父组件中
        }
        // 创建富文本编辑器
        this.editor.create()
      },
      deleteStudent () {
        this.$emit('deleteIndex', this.index)
      }
    }
  }
</script>

<style lang="css">
  .editor {
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 0;
  }
  .toolbar {
    border: 1px solid #ccc;
  }
  .text {
    border: 1px solid #ccc;
    min-height: 500px;
  }
</style>

引用

<template>
  <div>
    <div class="WeLanguage">
      <h1>自定义欢迎语</h1>
      <el-form ref="weLanguageForm">
        <el-form-item>
          <div class="weLanguageTemWrap" v-for="(item,index) in weLanguageForm">
            <div class="weLanguageTemTitle">
              <span class="welcomeLange">网站欢迎语</span>
              <span>
            <el-select v-model="item.weLanguageValue" multiple placeholder="请选择">
              <el-option
                v-for="iteml in weLanguageOptions"
                :key="iteml.value"
                :label="iteml.label"
                :value="iteml.value">
              </el-option>
            </el-select>
          </span>
            </div>
            <editor-bar v-model="it
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/sunlizhen/article/details/103531681

智能推荐

搭配要点2-程序员宅基地

文章浏览阅读204次。男士服装配色技术服搭配巧为参考: 成功男士服装配色技巧男士服装的颜色通常是三色或四颜色, 你在着几种颜色里面选择和匹配。蓝色-从深蓝色明亮到浅蓝色,蓝色是被认为成功男人穿衣服的最高比率, 是男人最基本的颜色, 所以它排列的男人穿衣服里面的颜色第一, 其他两种颜色是灰色和棕色的颜色, 所以基本上每个人都会有一到三套蓝色的衣服, 这是很正常的。蓝颜色会让我们想起蓝天, 蔚蓝的大海, 所以它是用..._搭配要点

2个基础问题:如何修改PCHAR?-程序员宅基地

文章浏览阅读72次。2个基础问题:如何修改PCHAR? Delphi / Windows SDK/APIhttp://www.delphi2007.net/DelphiBase/html/delphi_20061205132245286.html1.如何增加字符到PCHAR?如: p:pchar GetWindowText(p....) 想在前面加上个'D'如何加? (不..._public class frodo extends hobbit

打开私有仓库出现502 Bad Gateway_received unexpected http status: 502 bad gateway-程序员宅基地

文章浏览阅读3.4k次。问题现象:最新没有做过什么变更啊,上传镜像的时候出现[root@hdss7-200 ~]# docker push harbor.od.com/public/jenkins:v2.190.3The push refers to repository [harbor.od.com/public/jenkins]e0485b038afa: Retrying in 1 second2950fdd45d03: Retrying in 1 secondcfc53f61da25: Retrying in _received unexpected http status: 502 bad gateway

apipost 简单的性能压测总结_apipost压测-程序员宅基地

文章浏览阅读848次,点赞9次,收藏7次。2)数据库配置文件写了占了2G+内存(my.cnf文件),redis+syslog+nginx 最好2G内存-实际大概1G ,消息队列1G内存,Java系统推荐2~4G,所以8G内跑差不多1千;1)jdk默认256M给100用,推荐给1000+人同时用JVM 堆栈建议2G~4G(目前定了机型4核8G内存 2T磁盘做radio0存储);3)16G内存能够很好的跑1千+,最好适当调整mysql、nginx(跟cpu主要相关)、程序的jvm堆栈大小。(在接口旁边就有个一键压测),专业的还是得jmater;_apipost压测

卷积神经网络概念与原理-程序员宅基地

文章浏览阅读433次。一、卷积神经网络的基本概念 受Hubel和Wiesel对猫视觉皮层电生理研究启发,有人提出卷积神经网络(CNN),Yann Lecun 最早将CNN用于手写数字识别并一直保持了其在该问题的霸主地位。近年来卷积神经网络在多个方向持续发力,在语音识别、人脸识别、通用物体识别、运动分析、自然语言处理甚至脑电波分析方面均有突破。 卷积神经网络与普通神经网络的区别在于,..._一个神经元相当于多少个参数

WSL 参考的对象类型不支持尝试的操作。 Error code: Wsl/Service/0x8007273d-程序员宅基地

文章浏览阅读736次,点赞6次,收藏9次。关掉那种easyconnect的vpn。参考的对象类型不支持尝试的操作。_error code: wsl/service/0x8007273d

随便推点

英特尔表示,微软的 Copilot AI 将在未来的 PC 上本地运行-程序员宅基地

文章浏览阅读47次,点赞9次,收藏7次。支持 AI 的 PC 很快将能够直接在机器上处理更多 genAI 任务,从而有可能提高性能和隐私。

PAT甲级 1001 A+B Format 浙软机试备考(C++)-程序员宅基地

文章浏览阅读25次。【代码】PAT甲级 1001 A+B Format 浙软机试备考(C++)

svm理论与实验之18: libsvm自动参数选择-程序员宅基地

文章浏览阅读112次。徐海蛟博士 Teaching.libsvm可用grid.py(grid的意思是:网格)这个网格搜索python程序帮我们自动完成参数选择。这里,给童鞋们上课说说交叉验证与网格搜索。1. 交叉验证交叉验证是一种评估统计分析、机器学习算法对独立于训练数据的数据集的泛化能力,能够避免过拟合问题。交叉验证一般要尽量满足: 1)训练集的比例要足够多,一般大于一半(>50%) 2)..._java libsvm样本数量

操作系统原理模拟实验(基于C/C++模拟处理机调度、存储管理和文件系统)_用c语言假设一页存储1kb,可模拟为-程序员宅基地

文章浏览阅读1.2w次,点赞42次,收藏248次。包含完整的源代码可直接编译运行,以及相关核心逻辑方法的详细注解和实验要求一、处理机调度模拟二、存储管理模拟:动态分区分配、分页存储地址转换三、文件系统模拟如有需要,请前往Gitee进行源码的下载:https://gitee.com/JJJZZZYYY/operating-system-principleTip:如需转发或引用此博文及相关内容,请附带此原博文链接:https://blog.csdn.net/jzycloud/article/details/110703988_用c语言假设一页存储1kb,可模拟为

ExternalDocumentationLinkImpl(url=https://developer.android.com/reference/, packageListUrl=https://d-程序员宅基地

文章浏览阅读1.6k次。dokka问题java.lang.RuntimeException: Exception while loading package-list from ExternalDocumentationLinkImpl(url=https://developer.android.com/reference/, packageListUrl=https://developer.android...

通过AI算法识别狮子还是豹子-程序员宅基地

文章浏览阅读1.2k次,点赞21次,收藏18次。082基于CNN卷积网络的手势识别阿拉伯数字pyqt版本_含10多种模型包括alexnet、DenseNet、DLA、GoogleNet、Mobilenet、ResNet、ResNeXt、ShuffleNet、VGG、EfficientNet和Swin transformer等10多种模型。117nlp自然语言处理-文本情感分类-joy-sadness-anger-fear-love-surprise。然后本地的train.txt和val.txt里面存放的是数据集的图片路径和对应的标签。