提交 af9dcdef 编写于 作者: D DebugIsFalse

fix: 点击分享更新链接公开状态

上级 886faf06
......@@ -20,7 +20,7 @@
<UButton v-if="SM" color="gray" variant="ghost" leading-icon="i-heroicons-plus-20-solid">收藏</UButton>
</ClientOnly>
<UPopover>
<UButton :leading-icon="isOpen ? 'i-heroicons-share-20-solid' : 'i-heroicons-lock-closed-20-solid'">分享</UButton>
<UButton :leading-icon="isOpen ? 'i-heroicons-share-20-solid' : 'i-heroicons-lock-closed-20-solid'" @click="handleSetOpenState">分享</UButton>
<template #panel>
<div class="flex flex-col p-3 gap-2 min-w-72">
<div>访问权限</div>
......@@ -90,7 +90,7 @@ watch(()=> props.query, () => {
}, { immediate: true })
watch(() => props.isPublic, () => {
isOpen.value = props.isPublic
})
}, { immediate: true })
function handleFocusTitle () {
isEditTitle.value = true
}
......@@ -100,7 +100,6 @@ function handleBlurTitle () {
}
function handleShare (isUpdate) {
const shareType = String(isOpen.value)
useCopyToClipboard().copy(window.location.href)
toast.add({
icon: 'i-heroicons-information-circle-20-solid',
timeout: 2000,
......@@ -114,4 +113,10 @@ function handleUpdateOpenState (state) {
isOpen.value = state
handleShare(updateOpened)
}
function handleSetOpenState() {
if (!isOpen.value) {
isOpen.value = true
handleShare(true)
}
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册