0.1.0 • Published 2 years ago

avue-plugin-ueditor-wjh v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

avue 富文本编辑器

Avue官网

https://avuejs.com

介绍

三方编辑器wangEditor

  • 文档
  • 组件配置中customConfig属性为wangEditor编辑器的配置

使用

1.安装
npm install avue-plugin-ueditor --save

2.导入
import AvueUeditor from 'avue-plugin-ueditor'
Vue.use(AvueUeditor);

3.使用(双击图片可改变大小)
...
column:[
  ...
    {
      label:'test',
      prop:'test',
      component: "avueUeditor",
      params:{
        options:{
          //普通图片上传
          action: "https://avuejs.com/upload",
          customConfig: {
             lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
          },//wangEditor编辑的配置
          props: {
            res: "data",
            url:'url'
          },
          //七牛云oss配置
          qiniu: {
            AK: "",
            SK: "",
            scope: "test",
            url: "http://pm7cc17lu.bkt.clouddn.com/",
            deadline: 1
          },
          //阿里云oss配置
          ali: {
            region: "oss-cn-beijing",
            endpoint: "oss-cn-beijing.aliyuncs.com",
            accessKeyId: "",
            accessKeySecret: "",
            bucket: "avue"
          }
        }
      }
    }
  ...
]
或者直接
<avue-ueditor v-model="text" :options="options"></avue-ueditor>

4.图片上传配置————(支持oss,支持ctrl+v粘贴图片)
具体用法参考https://avuex.avue.top/#/doc/form-upload
options: {
  //普通图片上传
  action: "https://avuejs.com/upload",
  customConfig: {
     lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3']
  },//wangEditor编辑的配置
  props: {
    res: "data",
    url:'url'
  },
  //七牛云oss配置
  qiniu: {
    AK: "",
    SK: "",
    scope: "test",
    url: "http://pm7cc17lu.bkt.clouddn.com/",
    deadline: 1
  },
  //阿里云oss配置
  ali: {
    region: "oss-cn-beijing",
    endpoint: "oss-cn-beijing.aliyuncs.com",
    accessKeyId: "",
    accessKeySecret: "",
    bucket: "avue"
  }
}
...