zhangxiao
2024-08-09 61c2e839038e684119d03bccb24a4b7133c8a141
src/components/upload/index.vue
@@ -10,7 +10,7 @@
</template>
<script setup>
  import { computed, ref, watch, watchEffect } from 'vue';
  import { computed, ref, onMounted, watch, watchEffect } from 'vue';
  const props = defineProps({
    limit: {
      type: Number,
@@ -21,7 +21,7 @@
  });
  const emit = defineEmits(['update:fileList', 'success']);
  const urls = computed(() => props.url);
  const fileList = ref([]);
  watch(
@@ -41,6 +41,17 @@
    }
  );
  onMounted(() => {
    if (urls.value) {
      fileList.value = urls.value.split(',').map((item) => ({
        uid: item,
        name: item,
        status: 'done',
        url: item,
      }));
    }
  });
  // console.log(urls.value, 8988);
  const handleChange = (fileList) => {