修复type错误和lint --fix
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContentNavigationItem } from '@nuxt/content'
|
||||
import { findPageHeadline } from '#ui-pro/utils/content'
|
||||
|
||||
// import type { ContentNavigationItem } from '@nuxt/content'
|
||||
// import { findPageHeadline } from '#ui-pro/utils/content'
|
||||
|
||||
const route = useRoute()
|
||||
const appConfig = useAppConfig()
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
// const appConfig = useAppConfig()
|
||||
// const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
|
||||
// 获取主题系统的字号设置
|
||||
const { selectedFontSize } = useTheme()
|
||||
// const { selectedFontSize } = useTheme()
|
||||
|
||||
// 计算页面内容的字号类
|
||||
const pageFontSizeClass = computed(() => {
|
||||
return `text-${selectedFontSize.value}`
|
||||
})
|
||||
// const pageFontSizeClass = computed(() => {
|
||||
// return `text-${selectedFontSize.value}`
|
||||
// })
|
||||
|
||||
// 根据路由参数构建内容路径
|
||||
const path = computed(() => {
|
||||
@@ -49,7 +48,6 @@ const collection = computed(() => {
|
||||
return queryPath.value.startsWith('/blog') ? 'blog' : 'docs'
|
||||
})
|
||||
|
||||
|
||||
const { data: page } = await useAsyncData(
|
||||
`page-${route.path}`, // 使用更具体的 key
|
||||
() => queryCollection(collection.value).path(queryPath.value).first(),
|
||||
@@ -67,7 +65,6 @@ if (!page.value) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 复制状态
|
||||
const isCopied = ref(false)
|
||||
|
||||
@@ -76,7 +73,7 @@ const copyFullText = async () => {
|
||||
if (!page.value?.rawbody) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(page.value.rawbody)
|
||||
// 设置复制成功状态
|
||||
@@ -96,21 +93,21 @@ const copyFullText = async () => {
|
||||
<!-- 复制按钮 -->
|
||||
<div class="mb-4 flex justify-start">
|
||||
<UButton
|
||||
@click="copyFullText"
|
||||
:icon="isCopied ? 'lucide-check' : 'lucide-copy'"
|
||||
variant="solid"
|
||||
size="sm"
|
||||
@click="copyFullText"
|
||||
>
|
||||
{{ isCopied ? '已复制' : '复制全文' }}
|
||||
</UButton>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 原始内容显示区域 -->
|
||||
<div
|
||||
<div
|
||||
class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4 overflow-auto"
|
||||
style="user-select: text; -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text;"
|
||||
>
|
||||
<pre
|
||||
<pre
|
||||
class="whitespace-pre-wrap break-words text-sm"
|
||||
style="user-select: text; -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text;"
|
||||
>
|
||||
|
Reference in New Issue
Block a user