This commit is contained in:
2023-04-14 09:25:58 +08:00
parent 921ea417dd
commit 8da14bafef
10 changed files with 103 additions and 69 deletions

View File

@@ -24,12 +24,11 @@ function getCurrentType(name: string): "primary" | "default" {
return "default"
}
const options = computed<DropdownOption[]>(() => [
const options: DropdownOption[] = [
{ label: "比赛题目", key: "problems" },
{ label: "提交信息", key: "submissions" },
{ label: "比赛排名", key: "rank" },
{ label: "管理员助手", key: "helper", show: contestStore.isContestAdmin },
])
]
</script>
<template>
<div v-if="contestMenuVisible">
@@ -46,13 +45,6 @@ const options = computed<DropdownOption[]>(() => [
<n-button :type="getCurrentType('rank')" @click="goto('rank')">
比赛排名
</n-button>
<n-button
v-if="contestStore.isContestAdmin"
:type="getCurrentType('helper')"
@click="goto('helper')"
>
管理员助手
</n-button>
</n-space>
<n-dropdown v-else :options="options" trigger="click" @select="goto">
<n-button>菜单</n-button>