提交 a7011ae0 编写于 作者: View Design's avatar View Design

Update [id].vue

上级 5f5d8bda
......@@ -27,7 +27,7 @@
<section>{{ state.repo }}</section>
<template v-for="(item, index) in data" :key="index">
<h1 class="text-3xl truncate" v-if="index !== 0">{{ item.question }}</h1>
<h1 class="text-3xl truncate" v-if="index !== 0" :id="index + 1">{{ item.question }}</h1>
<UProgress :value="item.step" :max="steps" :color="stepColor(item.step)" indicator>
<template #step-1="{ step }">
<span class="text-blue-500 items-center justify-end flex space-x-1">
......@@ -61,6 +61,11 @@
<article>
{{ item.article }}
</article>
<div class="space-x-2">
<UButton size="xs" color="gray" @click="handleCopyMD(index)" leading-icon="i-heroicons-document-duplicate-20-solid" label="复制" />
<UButton size="xs" color="gray" @click="handleShare(index + 1)" leading-icon="i-heroicons-share-20-solid" label="分享" />
<UButton size="xs" color="gray" @click="handleReGenerate(index)" leading-icon="i-heroicons-arrow-path-rounded-square-20-solid" label="重写" />
</div>
<div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-link-20-solid" />
<span>来源</span>
......@@ -142,14 +147,20 @@ const handleFocusTitle = () => {
const handleBlurTitle = () => {
isEditTitle.value = false
}
const handleShare = () => {
useCopyToClipboard().copy(window.location.href)
const handleShare = (hash) => {
useCopyToClipboard().copy(window.location.href + (hash ? '#' + hash : ''))
toast.add({
icon: 'i-heroicons-information-circle-20-solid',
timeout: 2000,
title: '链接已复制到剪贴板'
})
}
const handleCopyMD = (index) => {
}
const handleReGenerate = (index) => {
}
const steps = ['', '问题分析', '代码搜索', '整理答案', '完成!']
const stepColor = (step) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册