🐛Fix: 修复组件不及时更新的问题

This commit is contained in:
2025-10-06 01:13:37 +08:00
parent afadb0ced7
commit 386cb79e1e
2 changed files with 48 additions and 11 deletions
+7 -1
View File
@@ -183,6 +183,12 @@ const saveConfig = () => {
resetForm()
showValidation('配置保存成功', 'success')
// TODO: 保存后应该使得 ChatPanel 组件刷新,使得能够选择厂商
// 触发全局事件,通知 ChatPanel 刷新配置
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent('config-saved', { detail: { platformId: selectedPlatform.value } }))
}
} catch (error) {
console.error('保存配置失败:', error)
showValidation('保存配置失败,请重试', 'error')
@@ -362,4 +368,4 @@ onMounted(() => {
.remove-btn:hover {
background-color: #c82333;
}
</style>
</style>