From e751c02c93e2f2eb59a479788c174672a41d5918 Mon Sep 17 00:00:00 2001 From: zhangxiao <898441624@qq.com> Date: 星期二, 06 八月 2024 10:12:05 +0800 Subject: [PATCH] fix: 编辑接口对接 --- src/components/upload/index.vue | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git a/src/components/upload/index.vue b/src/components/upload/index.vue index e0c517e..0329488 100644 --- a/src/components/upload/index.vue +++ b/src/components/upload/index.vue @@ -10,17 +10,57 @@ </template> <script setup> - import { ref } from 'vue'; + import { computed, ref, watch, watchEffect } from 'vue'; const props = defineProps({ limit: { type: Number, default: 1, }, action: String, // 涓婁紶鐨勬湇鍔″櫒鍦板潃 + url: String, //鍥炴樉鐨勬枃浠跺湴鍧� }); const emit = defineEmits(['update:fileList', 'success']); + const fileList = ref([]); + // const urls = computed(() => { + // debugger; + // console.log(props.url, 999999); + // // if (props.urlS) { + // // console.log(props.urlS, 999999); + // // return props.urlS.split(','); + // // } + + // // return props.urlS ? [props.urlS] : []; + // }); + // watchEffect(() => { + // fileList.value = urls.value.map((item) => ({ + // uid: item, + // name: item, + // status: 'done', + // url: item, + // })); + // }); + watch( + () => props.url, + (newVal) => { + debugger; + console.log(newVal, 8888); + // if (newVal) { + // fileList.value = newVal.split(',').map((item) => ({ + // uid: item, + // name: item, + // status: 'done', + // url: item, + // })); + // } + }, + { + deep: true, // 寮�鍚繁搴︾洃鍚� + } + ); + + // console.log(urls.value, 8988); const handleChange = (fileList) => { emit('update:fileList', fileList); -- Gitblit v1.8.0