瀏覽代碼

types: fix some types

xiaoxian521 3 年之前
父節點
當前提交
b87183cb75

+ 1 - 1
src/components/ReCharts/src/Github.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { ref } from "vue";
-const lists = ref<ForDataType<undefined>>([
+const lists = ref([
   { type: "", label: "善良" },
   { type: "success", label: "好学" },
   { type: "info", label: "幽默" },

+ 1 - 1
src/components/ReCharts/src/Infinite.vue

@@ -5,7 +5,7 @@ import SeamlessScroll from "/@/components/ReSeamlessScroll";
 
 const scroll = templateRef<ElRef | null>("scroll", null);
 
-let listData = ref<ForDataType<undefined>>([
+let listData = ref([
   {
     date: "2021-09-01",
     name: "vue-pure-admin",

+ 1 - 0
src/layout/components/sidebar/horizontal.vue

@@ -85,6 +85,7 @@ function backHome() {
 }
 
 function handleResize() {
+  // @ts-ignore
   menuRef.value.handleResize();
 }
 

+ 1 - 1
src/views/components/draggable/index.vue

@@ -21,7 +21,7 @@ let lists = ref<Array<Object>>([
   { people: "cn", id: 4, name: "www.google.com" }
 ]);
 
-let cutLists = ref<Array<Object>>([
+let cutLists = ref([
   { people: "cn", id: 1, name: "cut1" },
   { people: "cn", id: 2, name: "cut2" },
   { people: "cn", id: 3, name: "cut3" },

+ 1 - 1
src/views/components/seamless-scroll/index.vue

@@ -6,7 +6,7 @@ import SeamlessScroll from "/@/components/ReSeamlessScroll";
 // eslint-disable-next-line no-undef
 const scroll = templateRef<ElRef | null>("scroll", null);
 
-let listData = ref<ForDataType<undefined>>([
+let listData = ref([
   {
     title: "无缝滚动第一行无缝滚动第一行!!!!!!!!!!"
   },

+ 1 - 1
src/views/components/selector/index.vue

@@ -3,7 +3,7 @@ import { ref } from "vue";
 import Selector from "/@/components/ReSelector";
 
 let selectRange = ref<string>("");
-let dataLists = ref<ForDataType<undefined>>([
+let dataLists = ref([
   {
     title: "基本使用",
     echo: [],

+ 5 - 4
src/views/login.vue

@@ -1,16 +1,17 @@
 <script setup lang="ts">
+import { infoType } from "./type";
+import { useRouter } from "vue-router";
 import { reactive, onBeforeMount } from "vue";
-import info, { ContextProps } from "../components/ReInfo/index.vue";
 import { getVerify, getLogin } from "/@/api/user";
-import { useRouter } from "vue-router";
 import { storageSession } from "/@/utils/storage";
 import { warnMessage, successMessage } from "/@/utils/message";
+import info, { ContextProps } from "../components/ReInfo/index.vue";
 
 const router = useRouter();
 
 // 刷新验证码
 const refreshGetVerify = async () => {
-  let { svg } = await getVerify();
+  let { svg }: infoType = await getVerify();
   contextInfo.svg = svg;
 };
 
@@ -29,7 +30,7 @@ const toPage = (info: Object): void => {
 // 登录
 const onLogin = async () => {
   let { userName, passWord, verify } = contextInfo;
-  let { code, info, accessToken } = await getLogin({
+  let { code, info, accessToken }: infoType = await getLogin({
     username: userName,
     password: passWord,
     verify: verify

+ 1 - 1
src/views/permission/button/index.vue

@@ -2,7 +2,7 @@
 import { ref } from "vue";
 import { storageSession } from "/@/utils/storage";
 
-const auth = ref<Boolean>(storageSession.getItem("info").username || "admin");
+const auth = ref<boolean>(storageSession.getItem("info").username || "admin");
 
 function changRole(value) {
   storageSession.setItem("info", {

+ 6 - 0
src/views/type.ts

@@ -0,0 +1,6 @@
+export type infoType = {
+  svg?: string;
+  code?: number;
+  info?: string;
+  accessToken?: string;
+};

+ 3 - 4
src/views/welcome.vue

@@ -1,6 +1,4 @@
 <script setup lang="ts">
-import { ref, shallowRef, computed, onBeforeMount } from "vue";
-import { useAppStoreHook } from "/@/store/modules/app";
 import {
   ReGithub,
   ReInfinite,
@@ -8,10 +6,12 @@ import {
   ReLine,
   ReBar
 } from "/@/components/ReCharts/index";
+import { useAppStoreHook } from "/@/store/modules/app";
+import { ref, shallowRef, computed, onBeforeMount } from "vue";
 
 const date: Date = new Date();
 let loading = ref<boolean>(true);
-const componentList = shallowRef<ForDataType<undefined>>([]);
+const componentList = shallowRef([]);
 
 setTimeout(() => {
   loading.value = !loading.value;
@@ -89,7 +89,6 @@ const openDepot = (): void => {
         <img
           src="https://avatars.githubusercontent.com/u/44761321?s=400&u=30907819abd29bb3779bc247910873e7c7f7c12f&v=4"
           title="直达仓库地址"
-          alt
           @click="openDepot"
         />
         <span>{{ greetings }}</span>