更新多个组件以支持新的事件通知机制,添加切换到配置页面的功能,调整文档以反映组件文件名的变化,提升用户交互体验。

This commit is contained in:
jxxghp
2025-05-06 23:56:28 +08:00
parent 4586f6982a
commit 146a1fe23d
4 changed files with 63 additions and 54 deletions

View File

@@ -55,6 +55,10 @@
<v-icon left>mdi-refresh</v-icon>
刷新数据
</v-btn>
<v-btn color="primary" @click="notifySwitch">
<v-icon left>mdi-cog</v-icon>
配置
</v-btn>
</v-card-actions>
</v-card>
</div>
@@ -73,7 +77,7 @@ const status = ref('running')
const lastUpdated = ref('')
// 自定义事件,用于通知主应用刷新数据
const emit = defineEmits(['action'])
const emit = defineEmits(['action', 'switch'])
// 获取状态图标
function getItemIcon(type) {
@@ -138,6 +142,11 @@ async function refreshData() {
}
}
// 通知主应用切换到配置页面
function notifySwitch() {
emit('switch')
}
// 组件挂载时加载数据
onMounted(() => {
refreshData()