add auto-imports.

This commit is contained in:
2023-01-11 02:04:48 +08:00
parent 5c34d3c5e7
commit 77378f80a0
32 changed files with 819 additions and 117 deletions

View File

@@ -1,6 +1,4 @@
<script setup lang="ts">
import { onMounted, ref, reactive, watch } from "vue"
import { useRoute, useRouter } from "vue-router"
import { useUserStore } from "../../shared/stores/user"
import { filterEmptyValue, getTagColor } from "../../utils/functions"
import { isDesktop } from "../../utils/breakpoints"
@@ -22,7 +20,7 @@ const total = ref(0)
const { data: tags } = getProblemTagList()
const query = reactive({
keyword: route.query.keyword || "",
keyword: (route.query.keyword as string) || "",
difficulty: route.query.difficulty || "",
tag: route.query.tag || "",
page: parseInt(<string>route.query.page) || 1,
@@ -30,7 +28,7 @@ const query = reactive({
})
async function listProblems() {
query.keyword = route.query.keyword || ""
query.keyword = (route.query.keyword as string) || ""
query.difficulty = route.query.difficulty || ""
query.tag = route.query.tag || ""
query.page = parseInt(<string>route.query.page) || 1
@@ -155,7 +153,10 @@ onMounted(listProblems)
<el-table-column prop="title" label="标题" />
<el-table-column label="难度" width="100">
<template #default="scope">
<el-tag disable-transitions :type="getTagColor(scope.row.difficulty)">
<el-tag
disable-transitions
:type="(getTagColor(scope.row.difficulty) as any)"
>
{{ scope.row.difficulty }}
</el-tag>
</template>