Michael Wang 3 gadi atpakaļ
vecāks
revīzija
5ca916e841
1 mainītis faili ar 6 papildinājumiem un 9 dzēšanām
  1. 6 9
      src/features/mark/MarkHeader.vue

+ 6 - 9
src/features/mark/MarkHeader.vue

@@ -396,26 +396,23 @@ const logout = () => {
 
 
 let changeProfileRef = $ref<InstanceType<typeof MarkChangeProfile>>();
 let changeProfileRef = $ref<InstanceType<typeof MarkChangeProfile>>();
 
 
+// TODO: 应该是@typescript-eslint/no-unsafe-call不完美的搞法,导致了下面的调用会出错
+type ShowModalFunc = () => void;
+
 const openProfileModal = () => {
 const openProfileModal = () => {
-  // https://github.com/vuejs/vue-next/issues/4397
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-  changeProfileRef?.showModal();
+  (changeProfileRef.showModal as ShowModalFunc)();
 };
 };
 
 
 let switchGroupRef = $ref<InstanceType<typeof MarkSwitchGroupDialog>>();
 let switchGroupRef = $ref<InstanceType<typeof MarkSwitchGroupDialog>>();
 
 
 const openSwitchGroupModal = () => {
 const openSwitchGroupModal = () => {
-  // https://github.com/vuejs/vue-next/issues/4397
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-  switchGroupRef?.showModal();
+  (switchGroupRef.showModal as ShowModalFunc)();
 };
 };
 
 
 let problemRef = $ref<InstanceType<typeof MarkProblemDialog>>();
 let problemRef = $ref<InstanceType<typeof MarkProblemDialog>>();
 
 
 const openProblemModal = () => {
 const openProblemModal = () => {
-  // https://github.com/vuejs/vue-next/issues/4397
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
-  problemRef?.showModal();
+  (problemRef.showModal as ShowModalFunc)();
 };
 };
 
 
 watchEffect(() => {
 watchEffect(() => {