修改分享传递参数,清理注释
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user