2
0

fix:home界面组件更新联动

This commit is contained in:
zhongzm
2024-12-25 18:51:47 +08:00
parent 8edc1e19c7
commit 1c81fa2ec0
5 changed files with 24 additions and 3 deletions

View File

@@ -1,15 +1,26 @@
<script setup lang="ts">
import { ref } from 'vue';
import HeaderBanner from './modules/header-banner.vue';
import CardData from './modules/card-data.vue';
import LineChart from './modules/line-chart.vue';
// import PieChart from './modules/pie-chart.vue';
// import ProjectNews from './modules/project-news.vue';
// import CreativityBanner from './modules/creativity-banner.vue';
// 创建对 HeaderBanner 组件的引用
const headerBannerRef = ref();
// 创建更新仪表盘的方法
const updateDashboard = async () => {
await headerBannerRef.value?.updateDashboard();
};
// 提供更新方法给子组件
provide('updateDashboard', updateDashboard);
</script>
<template>
<ASpace direction="vertical" :size="16">
<HeaderBanner />
<HeaderBanner ref="headerBannerRef"/>
<LineChart />
<CardData />
<!-- <ARow :gutter="[16, 16]">-->