update vue to 3.3.
This commit is contained in:
@@ -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="标题">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -16,6 +16,7 @@ const color = computed(() => {
|
||||
const Icon = computed(() => {
|
||||
if (props.status === "passed") return Select
|
||||
if (props.status === "failed") return SemiSelect
|
||||
return {}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user