types: optimization type

This commit is contained in:
xiaoxian521 2021-09-19 19:41:38 +08:00
parent 8458d5d37b
commit feb1498d29
5 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, Ref } from "vue"; import { ref, watch } from "vue";
import { useRoute, useRouter, RouteLocationMatched } from "vue-router"; import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
const levelList: Ref<RouteLocationMatched[]> = ref([]); const levelList = ref([]);
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();

View File

@ -219,7 +219,7 @@ class EnclosureHttp {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
EnclosureHttp.axiosInstance EnclosureHttp.axiosInstance
.request(config) .request(config)
.then((response: EnclosureHttpResoponse) => { .then((response: undefined) => {
resolve(response); resolve(response);
}) })
.catch((error: any) => { .catch((error: any) => {

View File

@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, unref } from "vue"; import { ref, reactive, unref } from "vue";
import { templateRef } from "@vueuse/core"; import { templateRef } from "@vueuse/core";
import SeamlessScroll from "/@/components/ReSeamlessScroll"; import SeamlessScroll from "/@/components/ReSeamlessScroll";
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const scroll = templateRef<ElRef | null>("scroll", null); const scroll = templateRef<ElRef | null>("scroll", null);
let listData = ref<Array<Object>>([ let listData = ref<ForDataType<undefined>>([
{ {
title: "无缝滚动第一行无缝滚动第一行!!!!!!!!!!" title: "无缝滚动第一行无缝滚动第一行!!!!!!!!!!"
}, },
@ -36,11 +36,12 @@ let listData = ref<Array<Object>>([
} }
]); ]);
let classOption = ref<Object>({ let classOption = reactive({
direction: "top" direction: "top"
}); });
function changeDirection(val) { function changeDirection(val) {
// @ts-ignore
unref(scroll).reset(); unref(scroll).reset();
unref(classOption).direction = val; unref(classOption).direction = val;
} }

View File

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

View File

@ -65,5 +65,5 @@ module.exports = {
{ severity: "warning" } { severity: "warning" }
] ]
}, },
ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts"] ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts", "**/*.json"]
}; };