Просмотр исходного кода

调研宝
修复一次文件上传的bug

zhangwf 5 лет назад
Родитель
Сommit
e414ba0608
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      src/components/EditPanel.vue
  2. 3 0
      src/views/h5editor/index.vue

+ 1 - 0
src/components/EditPanel.vue

@@ -151,6 +151,7 @@ color:rgba(255,255,255,1);"
             <input
               style="display: none;position: absolute;top: 0px;"
               type="file"
+              accept="image/*"
               @change="showSelectedPicOrUnSelectedPic($event,false)"
               multiple
             />

+ 3 - 0
src/views/h5editor/index.vue

@@ -1227,6 +1227,7 @@ export default {
     async changeSelectedPicOrUnSelectedPic(event, isAddButton, position) {
       var that = this;
       let files = event.target.files;
+       console.log("上传按钮图片",files)
       if (!files.length) {
         return false;
       }
@@ -1278,11 +1279,13 @@ export default {
               }
             );
           } else if (files.length > 1) {
+           
             http.uploadMaterielFile(
               file,
               function(res) {
                 that.buttonData.itemId = that.itemId;
                 that.buttonData.isButton = true;
+                 console.log("当前图片对象",files[0])
                 if (res.endsWith(files[0].name)) {
                   that.buttonData.backgroundUnselectedImg = res;
                 } else if (res.endsWith(files[1].name)) {