types: fix some types

This commit is contained in:
xiaoxian521
2021-10-13 21:44:49 +08:00
parent 80328d2e20
commit b87183cb75
10 changed files with 22 additions and 15 deletions

View File

@@ -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" },

View File

@@ -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: "无缝滚动第一行无缝滚动第一行!!!!!!!!!!"
},

View File

@@ -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: [],

View File

@@ -1,16 +1,17 @@
<script setup lang="ts">
import { reactive, onBeforeMount } from "vue";
import info, { ContextProps } from "../components/ReInfo/index.vue";
import { getVerify, getLogin } from "/@/api/user";
import { infoType } from "./type";
import { useRouter } from "vue-router";
import { reactive, onBeforeMount } from "vue";
import { getVerify, getLogin } from "/@/api/user";
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

View File

@@ -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
src/views/type.ts Normal file
View File

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

View File

@@ -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>