code refactor

This commit is contained in:
MaysWind
2025-01-11 02:50:51 +08:00
parent 5649bb243d
commit 61f26e060e
2 changed files with 3 additions and 10 deletions
+3 -2
View File
@@ -7,8 +7,7 @@
<script setup lang="ts">
import { type Ref, ref, computed, watch, onMounted } from 'vue';
import type { Notification } from 'framework7/components/notification';
import type { Actions, Dialog, Popover, Popup, Sheet } from 'framework7/types';
import type { Notification, Actions, Dialog, Popover, Popup, Sheet } from 'framework7/types';
import { f7ready } from 'framework7-vue';
import routes from './router/mobile.js';
@@ -192,6 +191,8 @@ onMounted(() => {
watch(currentNotificationContent, (newValue) => {
if (notification.value) {
notification.value.close();
// @ts-expect-error there is an "destroy" function in the Notification component, but it is not defined in the type definition file
// see https://framework7.io/docs/notification
notification.value.destroy();
notification.value = null;
}
-8
View File
@@ -21,11 +21,3 @@ interface Window {
interface Navigator {
browserLanguage?: string;
}
declare module "framework7/components/notification" {
export namespace Notification {
export interface Notification {
destroy(): void;
}
}
}