修改分享传递参数,清理注释

This commit is contained in:
2025-08-10 16:38:55 +08:00
parent 3b9fae1eea
commit 06de0f2b33
2 changed files with 15 additions and 44 deletions

View File

@@ -2,6 +2,12 @@
import { useClipboard } from '@vueuse/core'
import WxShare from '~/components/shared/wxShare.vue'
const props = defineProps<{
title?: string
desc?: string
imgUrl?: string
}>()
const route = useRoute()
const toast = useToast()
const { copy, copied } = useClipboard()
@@ -15,8 +21,9 @@ const markdownLink = computed(() => `${origin.value}/raw${decodeURIComponent(rou
const enableWxShare = ref(false)
const shareTitle = computed(() => (import.meta.client ? (document.title || 'Estel Docs') : ''))
const shareDesc = computed(() => (import.meta.client ? (document.title || 'Estel Docs') : ''))
const shareTitle = computed(() => props.title ?? (import.meta.client ? (document.title || 'Estel Docs') : ''))
const shareDesc = computed(() => props.desc ?? (import.meta.client ? (document.title || 'Estel Docs') : ''))
const shareImg = computed(() => props.imgUrl ?? '/images/default-blog.jpg')
const items = [
{
@@ -106,6 +113,7 @@ const items = [
:url="mdcLink"
:title="shareTitle"
:desc="shareDesc"
:img-url="shareImg"
/>
</ClientOnly>
</template>