From 9fca3ac2f0ffdbe2fb603cdbcff291b6c91892eb Mon Sep 17 00:00:00 2001 From: xjf <378266566@qq.com> Date: Tue, 23 Sep 2025 22:07:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=95=B0=E6=8D=AE=E5=8F=98=E5=8C=96=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/demo/components/ProjectCard.vue | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/views/dashboard/demo/components/ProjectCard.vue b/src/views/dashboard/demo/components/ProjectCard.vue index 9031ec8..20a26c8 100644 --- a/src/views/dashboard/demo/components/ProjectCard.vue +++ b/src/views/dashboard/demo/components/ProjectCard.vue @@ -10,17 +10,17 @@ const props = defineProps({ default: () => {}, }, }) +const gridData = ref([]) + watch( () => props.data, (newValue, oldValue) => { // 下方信息不会打印在控制台中 console.log('a has changed', newValue, oldValue) + getNewData() }, ) -const gridData = ref([]) - -// 页面挂载时批量请求并更新数据(避免在模板中调用异步) -onMounted(async () => { +async function getNewData() { const rows = props.data.Content || [] for (const item of rows) { try { @@ -38,7 +38,29 @@ onMounted(async () => { catch (e) { } } -}) +} + + +// 页面挂载时批量请求并更新数据(避免在模板中调用异步) +// onMounted(async () => { +// const rows = props.data.Content || [] +// for (const item of rows) { +// try { +// const param = item.Point +// const res = await getExaNow(param) + +// let ifColor: boolean = false +// if (res != null) +// ifColor = res === '1' + +// gridData.value.push(Object.assign({}, item, { ifColor })) + +// console.log(gridData.value) +// } +// catch (e) { +// } +// } +// })