update vue to 3.3.

This commit is contained in:
2023-05-16 19:14:43 +08:00
parent 271d662554
commit c27f5c43c7
7 changed files with 169 additions and 256 deletions

View File

@@ -84,7 +84,7 @@ onMounted(getContestDetail)
<template>
<h2 class="title">
{{ $route.name === "admin contest create" ? "新建比赛" : "编辑比赛" }}
{{ route.name === "admin contest create" ? "新建比赛" : "编辑比赛" }}
</h2>
<n-form inline>
<n-form-item label="标题">

View File

@@ -7,6 +7,7 @@ const userCount = ref(0)
const submissionCount = ref(0)
const contestCount = ref(0)
const userStore = useUserStore()
const router = useRouter()
party.resolvableShapes["fries"] = `<span style="font-size: 100px">🍟</span>`
party.resolvableShapes["joker"] = `<span style="font-size: 100px">🤡</span>`
@@ -47,8 +48,8 @@ onMounted(async () => {
</h2>
<n-space align="center">
<span>我猜你要</span>
<n-button @click="$router.push('/admin/problem/create')">新题目</n-button>
<n-button @click="$router.push('/admin/contest/create')">新比赛</n-button>
<n-button @click="router.push('/admin/problem/create')">新题目</n-button>
<n-button @click="router.push('/admin/contest/create')">新比赛</n-button>
<n-button @click="partyBegin1">来点薯条</n-button>
<n-button @click="partyBegin2">做回自己</n-button>
</n-space>

View File

@@ -16,6 +16,7 @@ const color = computed(() => {
const Icon = computed(() => {
if (props.status === "passed") return Select
if (props.status === "failed") return SemiSelect
return {}
})
</script>

View File

@@ -3,6 +3,7 @@ import { getProfile } from "~/shared/api"
import { Profile } from "~/utils/types"
const route = useRoute()
const router = useRouter()
const profile = ref<Profile | null>(null)
const problems = ref<string[]>([])
const [loading, toggle] = useToggle()
@@ -55,7 +56,7 @@ onMounted(init)
<n-button
v-for="id in problems"
key="id"
@click="$router.push('/problem/' + id)"
@click="router.push('/problem/' + id)"
>
{{ id }}
</n-button>
@@ -64,7 +65,7 @@ onMounted(init)
</n-descriptions>
<n-empty v-if="!loading && !profile" description="该用户不存在">
<template #extra>
<n-button @click="$router.push('/')">返回主页</n-button>
<n-button @click="router.push('/')">返回主页</n-button>
</template>
</n-empty>
</template>

View File

@@ -111,13 +111,13 @@ function goHome() {
</n-space>
<n-space align="center">
<n-dropdown
v-if="$route.name === 'learn' && isMobile"
v-if="route.name === 'learn' && isMobile"
trigger="click"
:options="learnStore.menu"
>
<n-button>目录</n-button>
</n-dropdown>
<div v-if="$route.name === 'learn'">
<div v-if="route.name === 'learn'">
<n-button v-if="isDesktop" type="primary" @click="run">
运行代码
</n-button>