jiangping
2025-03-18 1b0cf0db5c82ea8308d2f338973a91555787c34d
admin/src/components/common/UploadAvatarImage.vue
@@ -2,6 +2,7 @@
  <div>
    <el-upload
      class="avatar-uploader"
      accept=".png,.jpg"
      :action="uploadImgUrl"
      :data="uploadData"
      :show-file-list="false"
@@ -9,14 +10,12 @@
      :on-error="uploadError"
      :before-upload="beforeAvatarUpload">
      <template v-if="file.imgurlfull">
        <img  :src="file.imgurlfull" class="avatar">
        <img :src="file.imgurlfull" class="avatar">
      </template>
      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
    </el-upload>
  </div>
</template>
<script>
@@ -38,7 +37,7 @@
      imgurlfull: ''
    }
  },
  methods: {
    // 上传图片
    handleAvatarSuccess(res, file) {
@@ -59,9 +58,9 @@
    // // 拦截
    beforeAvatarUpload(file) {
      this.$emit('uploadBegin')
      return true;
    },
  },
      return true
    }
  }
}
</script>