yinbangzhong
2024-09-10 1da0bc255179f25b5227bec27833cf486cb6cb90
src/components/upload/index.vue
@@ -5,6 +5,7 @@
    :limit="limit"
    :action="action"
    @change="handleChange"
    @before-remove="beforeRemove"
    image-preview
  />
</template>
@@ -23,7 +24,7 @@
    url: String, //回显的文件地址
  });
  const emit = defineEmits(['update:fileList', 'success']);
  const emit = defineEmits(['update:fileList', 'success', 'handleRemove']);
  const urls = computed(() => props.url);
  const fileList = ref([]);
@@ -62,6 +63,10 @@
  });
  // console.log(urls.value, 8988);
  const beforeRemove = (file) => {
    emit('handleRemove');
    fileList.value = [];
  };
  const handleChange = (fileList) => {
    emit('update:fileList', fileList);