update
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
submissionMemoryFormat,
|
submissionMemoryFormat,
|
||||||
submissionTimeFormat,
|
submissionTimeFormat,
|
||||||
utoa,
|
utoa,
|
||||||
|
copyToClipboard,
|
||||||
} from "utils/functions"
|
} from "utils/functions"
|
||||||
import { Submission } from "utils/types"
|
import { Submission } from "utils/types"
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
||||||
@@ -23,6 +24,7 @@ const props = defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
const submission = ref<Submission>()
|
const submission = ref<Submission>()
|
||||||
|
|
||||||
@@ -64,7 +66,13 @@ function copyToCat() {
|
|||||||
window.open(url, "_blank")
|
window.open(url, "_blank")
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyToProblem() {
|
async function copyToProblem() {
|
||||||
|
const success = await copyToClipboard(submission.value!.code)
|
||||||
|
if (success) {
|
||||||
|
message.success("代码复制成功")
|
||||||
|
} else {
|
||||||
|
message.error("代码复制失败")
|
||||||
|
}
|
||||||
router.push({
|
router.push({
|
||||||
name: "problem",
|
name: "problem",
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
Reference in New Issue
Block a user