add empty display.

This commit is contained in:
2023-03-09 14:35:17 +08:00
parent 18a20c04c5
commit 237861ab3f
6 changed files with 31 additions and 113 deletions

View File

@@ -1,111 +1,17 @@
# 11 # 我是一级标题
## 1 ## 我是二级标题
哈哈 ### 我是三级标题
```c {3-4} 我是代码
```c
#include<stdio.h> #include<stdio.h>
int main() { int main()
{
printf("hello world");
return 0; return 0;
} }
``` ```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123
# 11
## 1
哈哈
```c {3-4}
#include<stdio.h>
int main() {
return 0;
}
```
123

View File

@@ -2,5 +2,6 @@
int main() int main()
{ {
printf("我是右侧的代码");
return 0; return 0;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -1 +1,7 @@
asas 随便写写
图片 1
![tupian](./WX20220628-084503@2x.png)
图片 2
<img src="./WX20220628-084503@2x.png" style="width: 100%"/>

View File

@@ -128,11 +128,7 @@ function rowProps(row: Contest) {
/> />
</n-form-item> </n-form-item>
<n-form-item label="搜索比赛标题"> <n-form-item label="搜索比赛标题">
<n-input <n-input placeholder="输入后回车或点击搜索" clearable @change="search" />
placeholder="输入后回车或点击搜索"
v-model:value="query.keyword"
@change="search"
/>
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<n-space> <n-space>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { getProblem } from "oj/api" import { getProblem } from "oj/api"
import { isDesktop, isMobile } from "~/shared/composables/breakpoints" import { isDesktop } from "~/shared/composables/breakpoints"
import { Problem } from "utils/types" import { Problem } from "utils/types"
const Editor = defineAsyncComponent(() => import("./components/Editor.vue")) const Editor = defineAsyncComponent(() => import("./components/Editor.vue"))
@@ -19,11 +19,19 @@ interface Props {
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
contestID: "", contestID: "",
}) })
const problem = ref<Problem>() const problem = ref<Problem | null>(null)
const errMsg = ref("无数据")
async function init() { async function init() {
const res = await getProblem(props.problemID, props.contestID) try {
problem.value = res.data const res = await getProblem(props.problemID, props.contestID)
problem.value = res.data
} catch (err: any) {
problem.value = null
if (err.data === "Contest has not started yet.") {
errMsg.value = "比赛还没有开始"
}
}
} }
onMounted(init) onMounted(init)
provide("problem", readonly(problem)) provide("problem", readonly(problem))
@@ -58,6 +66,7 @@ provide("problem", readonly(problem))
<Editor :problem="problem" /> <Editor :problem="problem" />
</n-gi> </n-gi>
</n-grid> </n-grid>
<n-empty v-else :description="errMsg"></n-empty>
</template> </template>
<style scoped></style> <style scoped></style>