🐛Fix: 修复组件不及时更新的问题
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user