fix:home界面组件更新联动
This commit is contained in:
@@ -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]">-->
|
||||
|
||||
Reference in New Issue
Block a user