Avue 富文本编辑器 avue-plugin-ueditor 无法上传图片

//package.json
"dependencies": { "@smallwei/avue": "^2.8.23", "avue-plugin-ueditor": "^0.2.3", "vue": "^2.6.14" }, "devDependencies": { "@vue/cli-service": "4.4.4", "vue-template-compiler": "^2.5.17" }
//main.js
import AvueUeditor from "avue-plugin-ueditor";
Vue.use(AvueUeditor);

//解决post请求报错
import axios from "axios";
Vue.prototype.$axios = axios;
//使用 .vue
<template>
  <basic-container>
    <avue-crud v-bind="bindVal" v-on="onEvent" v-model="form" :page.sync="page">
      <template #contentForm="{type,disabled}">
        <avue-ueditor v-model="text" :options="options"></avue-ueditor>
      </template>
    </avue-crud>
  </basic-container>
</template>

<script>
export default {
    data() {
      return {
        text: "",
        options: {
          //普通图片上传
          action: "https://avuejs.com/imgupload",
          customConfig: {}, //wangEditor编辑的配置
          props: {
            res: "data",
            url: "url",
          },
        },
      };
    },

 }

注意版本号,使用“

https://avuejs.com/imgupload

”记得配置跨域

原文地址:https://www.cnblogs.com/Bob0411/p/15410966.html