Browse Source

fix:修改监听卡片数据变化的bug

pull/57/head
xjf 2 weeks ago
parent
commit
9fca3ac2f0
  1. 32
      src/views/dashboard/demo/components/ProjectCard.vue

32
src/views/dashboard/demo/components/ProjectCard.vue

@ -10,17 +10,17 @@ const props = defineProps({
default: () => {},
},
})
const gridData = ref<any>([])
watch(
() => props.data,
(newValue, oldValue) => {
//
console.log('a has changed', newValue, oldValue)
getNewData()
},
)
const gridData = ref<any>([])
//
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) {
// }
// }
// })
</script>
<template>

Loading…
Cancel
Save