1. 程式人生 > 其它 >Avue 富文字編輯器 avue-plugin-ueditor 無法上傳圖片

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

”記得配置跨域