zoukankan      html  css  js  c++  java
  • [javascript] vue项目cdn模式下使用wangEditor

    在GOFLY项目的实现过程中,需要使用富文本编辑器,现在使用下wangEditor

    很简单,先引入

    <script src="https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js"></script>

    再使用

    html中

    <div id="welcomeEditor"></div>

    在methods方法中加入

                initEditor(){
                    if(this.editor!=null){
                        return;
                    }
                    const E = window.wangEditor
                    this.editor = new E('#welcomeEditor')
                    this.editor.config.height = 240;
                    this.editor.config.menus = [
                        'head',
                        'bold',
                        'fontSize',
                        'fontName',
                        'italic',
                        'underline',
                        'strikeThrough',
                        'indent',
                        'lineHeight',
                        'foreColor',
                        'backColor',
                        'link',
                        'justify',
                        'emoticon',
                        'table',
                        'splitLine',
                        'undo',
                        'redo',
                    ]
                    this.editor.create();
                }
            },

    获取html内容

    this.editor.txt.html();

    开源作品

    GOFLY是一款基于Golang+Vue开发的在线客服系统,软件著作权编号:2021SR1462600。一套可私有化部署的在线客服系统,编译后的二进制文件可直接使用无需搭开发环境,下载zip解压即可,仅依赖MySQL数据库,是一个开箱即用的网页在线客服系统,致力于帮助广大开发者/中小站长快速整合私有客服功能。
    github地址:go-fly
    官网地址:https://gofly.sopans.com
  • 相关阅读:
    vue-cli3使用cdn引入
    修饰器
    go strconv
    【BZOJ 5125】小Q的书架
    【NOI 2009】诗人小G
    后缀数组
    点分治
    四边形不等式
    【NOIP 2015】Day2 T3 运输计划
    【NOIP 2016】Day1 T2 天天爱跑步
  • 原文地址:https://www.cnblogs.com/taoshihan/p/15808575.html
Copyright © 2011-2022 走看看