Skip to content

Commit

Permalink
types: fix some types
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Oct 13, 2021
1 parent 80328d2 commit b87183c
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/ReCharts/src/Github.vue
Original file line number Diff line number Diff line change
@@ -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: "幽默" },
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReCharts/src/Infinite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/layout/components/sidebar/horizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function backHome() {
}
function handleResize() {
// @ts-ignore
menuRef.value.handleResize();
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/draggable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/seamless-scroll/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: "无缝滚动第一行无缝滚动第一行!!!!!!!!!!"
},
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/selector/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
9 changes: 5 additions & 4 deletions src/views/login.vue
Original file line number Diff line number Diff line change
@@ -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;
};
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/views/permission/button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
6 changes: 6 additions & 0 deletions src/views/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type infoType = {
svg?: string;
code?: number;
info?: string;
accessToken?: string;
};
7 changes: 3 additions & 4 deletions src/views/welcome.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script setup lang="ts">
import { ref, shallowRef, computed, onBeforeMount } from "vue";
import { useAppStoreHook } from "/@/store/modules/app";
import {
ReGithub,
ReInfinite,
RePie,
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;
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit b87183c

Please sign in to comment.