Procházet zdrojové kódy

localStorage 代码提示

xiaochan před 1 rokem
rodič
revize
a37fb6cfb6
2 změnil soubory, kde provedl 29 přidání a 2 odebrání
  1. 29 0
      src/local-storage.d.ts
  2. 0 2
      src/router/modules/dashboard.ts

+ 29 - 0
src/local-storage.d.ts

@@ -0,0 +1,29 @@
+// interface test {
+//     aas: string
+//     bbb: string[]
+// }
+//
+// const test = {
+//     aas: '',
+//     bbb: ['asd', '123123']
+// }
+//
+// function aa<T extends keyof test>(value: T): test[T] {
+//     return test[value]
+// }
+//
+// aa('aas')
+
+interface Storage {
+    getItem(key: string): string | null;
+
+    setItem(key: string, value: string): void;
+
+    removeItem(key: string): void;
+
+    clear(): void;
+
+    token: string | null
+}
+
+declare var localStorage: Storage;

+ 0 - 2
src/router/modules/dashboard.ts

@@ -1,9 +1,7 @@
 // @ts-nocheck
-import Layout from '@/layout/index.vue'
 import {createNameComponent} from '../createNode'
 import {RouteRecordRaw} from "vue-router";
 
-
 declare module 'vue-router' {
     interface RouteMeta {
         title?: string;