From 1606cbed5beef1dd04a3235d4bc3fd30ea45eb1e Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期五, 09 八月 2024 11:13:29 +0800
Subject: [PATCH] 智能体页面bug修改
---
src/components/upload/index.vue | 50 +++++++++++++++++++++-----------------------------
1 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/src/components/upload/index.vue b/src/components/upload/index.vue
index 0329488..ffae588 100644
--- a/src/components/upload/index.vue
+++ b/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,45 +21,37 @@
});
const emit = defineEmits(['update:fileList', 'success']);
-
+ const urls = computed(() => props.url);
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,
- // }));
- // }
+ if (newVal) {
+ fileList.value = newVal.split(',').map((item) => ({
+ uid: item,
+ name: item,
+ status: 'done',
+ url: item,
+ }));
+ }
},
{
deep: true, // 寮�鍚繁搴︾洃鍚�
}
);
+ 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) => {
--
Gitblit v1.8.0