add problem.

This commit is contained in:
2023-01-05 10:24:06 +08:00
parent 56e28abfa6
commit f88c053848
9 changed files with 228 additions and 102 deletions

View File

@@ -1,8 +1,9 @@
<script setup lang="ts">
import { onMounted, ref, reactive, watch, VueElement } from "vue"
import { onMounted, ref, reactive, watch } from "vue"
import { useRoute, useRouter } from "vue-router"
import { useUserStore } from "../../shared/stores/user"
import { filterEmptyValue } from "../../utils/functions"
import { getTagColor } from "../../utils/constants"
import { getProblemList, getProblemTagList, getRandomProblemID } from "../api"
const difficultyOptions = [
@@ -27,14 +28,6 @@ const query = reactive({
limit: parseInt(<string>route.query.limit) || 10,
})
function getTagColor(tag: string) {
return {
简单: "success",
中等: "",
困难: "danger",
}[tag]
}
async function listTags() {
const res = await getProblemTagList()
tags.value = res.data