• 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

    ”记得配置跨域

  • 相关阅读:
    第十三周总结
    第十二周作业
    第十一周课程总结
    第十周课程总结
    第九周课程总结&实验报告(七)
    第八周课程总结&实验报告(六)
    第七周课程总结&实验报告(五)
    第六周&java实验报告四
    课程总结
    第二周课程总结
  • 原文地址:https://www.cnblogs.com/Bob0411/p/15410966.html
Copyright © 2020-2023  润新知