fix(component): 🐛 下拉代码, 解决popup的ref可能为空的情况

This commit is contained in:
Json_Lee 2025-06-02 11:43:07 +08:00
parent 165a4748bb
commit edcf1d5941
3 changed files with 15 additions and 2 deletions

View File

@ -40,7 +40,7 @@ async function showPopover() {
// //
function handleClick(item: GetSessionListVO) { function handleClick(item: GetSessionListVO) {
modelStore.setCurrentModelInfo(item); modelStore.setCurrentModelInfo(item);
popoverRef.value.hide(); popoverRef.value?.hide?.();
} }
</script> </script>

View File

@ -54,7 +54,7 @@ function handleClick(item: any) {
console.log('点击了设置'); console.log('点击了设置');
break; break;
case '4': case '4':
popoverRef.value.hide(); popoverRef.value?.hide?.();
ElMessageBox.confirm('退出登录不会丢失任何数据,你仍可以登录此账号。', '确认退出登录?', { ElMessageBox.confirm('退出登录不会丢失任何数据,你仍可以登录此账号。', '确认退出登录?', {
confirmButtonText: '确认退出', confirmButtonText: '确认退出',
cancelButtonText: '取消', cancelButtonText: '取消',

13
types/import_meta.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_WEB_TITLE: string;
readonly VITE_WEB_TITLE_EN: string;
readonly VITE_WEB_ENV: string;
readonly VITE_WEB_BASE_API: string;
readonly VITE_API_URL: string;
}
declare interface ImportMeta {
readonly env: ImportMetaEnv;
}