第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用element-ui提供的upload組件上傳圖片到本地時,action地址是后臺處理的地址嗎?

使用element-ui提供的upload組件上傳圖片到本地時,action地址是后臺處理的地址嗎?

蝴蝶不菲 2019-03-07 15:15:30
1.element官網提供的demo,上傳圖片<body><div id="app"><el-upload class="upload-demo" action="http://localhost:63342/springcloudservice/page-server/templates/images/project/"        :on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove"        multiple :limit="3" :on-exceed="handleExceed" :file-list="fileList">    <el-button size="small" type="primary">點擊上傳</el-button>    <div slot="tip" class="el-upload__tip">只能上傳jpg/png文件,且不超過500kb</div></el-upload></div></body><script>var vue=new Vue({    el: '#app',    data() {        return {            fileList: [                {                    name: 'food.jpeg',                    url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'                },                {                    name: 'food2.jpeg',                    url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'                }            ]        };    },    methods: {//這里用于定義方法        handleRemove:function(file, fileList) {            console.log(file, fileList);        },        handlePreview:function(file) {            console.log(file);        },        handleExceed:function(files, fileList) {//當前限制選擇 3 個文件,本次選擇了 ${files.length} 個文件,共選擇了 ${files.length + fileList.length} 個文件            this.$message.warning('限制為3個');        },        beforeRemove:function(file, fileList) {            return this.$confirm('確定移除 '+ file.name +'?');        }    },    computed: {//計算屬性    }})</script>2.action參數為上傳的地址,我想要上傳到項目所在目錄的images文件夾下,地址寫成了"http://localhost:63342/springcloudservice/page-server/templates/images/",但是前端控制臺報錯404,不能直接這么寫地址嗎?
查看完整描述

1 回答

?
aluckdog

TA貢獻1847條經驗 獲得超7個贊

這里不是直接寫個目錄,是要寫個api地址,接收你上傳的數據,然后存到這個目錄


查看完整回答
反對 回復 2019-03-26
  • 1 回答
  • 0 關注
  • 9596 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號