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

Merge branch 'main' of gitcode.com:git_bot/ai-fe

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