-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Upd] 优化部分逻辑
- Loading branch information
Showing
6 changed files
with
129 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<div class="side-blank"> | ||
<el-button | ||
@click="answerDialogVisible=true" | ||
> | ||
参考答案 | ||
</el-button> | ||
<el-dialog | ||
v-model="answerDialogVisible" | ||
title="参考答案" | ||
width="40%" | ||
draggable | ||
align-center | ||
> | ||
<div | ||
class="div-style" | ||
> | ||
{{ answer }} | ||
</div> | ||
</el-dialog> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
answerDialogVisible: false, | ||
} | ||
}, | ||
computed: { | ||
answer() { | ||
return localStorage.getItem(window.location.hash.split("&")[0].split("id=")[1]) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.side-blank { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 10px; | ||
} | ||
.div-style { | ||
white-space: pre-line; | ||
overflow: auto; | ||
height: 300px; | ||
color: black; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {createApp} from "vue"; | ||
import written from "../components/written.vue"; | ||
import ElementPlus from "element-plus"; | ||
|
||
export function show_answer_for_written() { | ||
if (localStorage.getItem(window.location.hash.split("&")[0].split("id=")[1]) === null) { | ||
alert("未找到答案,请重新进入当前页面"); | ||
} else { | ||
setTimeout(() => { | ||
createApp(written).use(ElementPlus).mount( | ||
(() => { | ||
const app = document.createElement("div"); | ||
document.querySelector("#app > div > div.card > div.main").appendChild(app) | ||
return app; | ||
})(), | ||
); | ||
}, 1000) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters