作者 xiaoqiu

规范了类型

... ... @@ -10,7 +10,7 @@ import { getClassifyList } from "~/api/classify";
import type { webSiteType } from "~/api/types/webSite";
import type { classifyType } from "~/api/types/classify";
const webSite = useState<webSiteType>("webSite");
const sortList = useState<classifyType>("sortTree");
const sortList = useState<classifyType[]>("sortTree");
webSite.value = await getWebSite();
sortList.value = await getClassifyList();
... ...
... ... @@ -59,8 +59,9 @@
</template>
<script setup lang="ts">
import type { classifyType } from "~/api/types/classify";
import { ArrowRightBold, ArrowDownBold } from "@element-plus/icons-vue";
const sortList = useState("sortTree");
const sortList = useState<classifyType[]>("sortTree");
// 激活的分类索引
const activeCategory = ref<number | null>(0);
const route = useRoute();
... ...
... ... @@ -2,7 +2,7 @@
<div class="md:p-10 p-4 pt-0" style="min-height: calc(100vh - 320px)">
<HomeRecommend
:recommendList="list"
:navTitle="findLabelByAlias(name as string, sortList as any)"
:navTitle="findLabelByAlias(name as string, sortList)"
navIcon="tag"
/>
<el-pagination
... ... @@ -21,7 +21,7 @@
import type { appType } from "~/api/types/app";
import { getAppList } from "~/api/app";
import type { classifyType } from "~/api/types/classify";
const sortList = useState<classifyType>("sortTree");
const sortList = useState<classifyType[]>("sortTree");
const route = useRoute();
const router = useRouter();
const { name } = route.params;
... ...
... ... @@ -3,7 +3,7 @@
<!-- 推荐工具区 -->
<HomeRecommend
:recommendList="list"
:navTitle="findLabelByAlias(name as string, sortList as any)"
:navTitle="findLabelByAlias(name as string, sortList)"
navIcon="tag"
:navTitleWidth="120.5"
/>
... ... @@ -23,7 +23,7 @@
import type { appType } from "~/api/types/app";
import { getAppList } from "~/api/app";
import type { classifyType } from "~/api/types/classify";
const sortList = useState<classifyType>("sortTree");
const sortList = useState<classifyType[]>("sortTree");
const route = useRoute();
const router = useRouter();
const { pageNum, name } = route.params;
... ...