6464 <button class =" copy-sub-link" @click.stop =" onClickShareLink" >
6565 <font-awesome-icon icon =" fa-solid fa-link" />
6666 </button >
67+ <button class =" copy-sub-link" @click.stop =" onClickCopyLink" >
68+ <font-awesome-icon icon =" fa-solid fa-clone" />
69+ </button >
6770 <!-- 编辑 -->
6871 <button class =" refresh-sub-flow" @click.stop =" onClickEdit" >
6972 <font-awesome-icon icon =" fa-solid fa-pen-nib" />
123126</template >
124127
125128<script lang="ts" setup>
129+ import { useClipboard } from " @vueuse/core" ;
130+ import useV3Clipboard from " vue-clipboard3" ;
126131import { Dialog , Toast } from " @nutui/nutui" ;
127132import dayjs from " dayjs" ;
128133import { storeToRefs } from " pinia" ;
@@ -138,14 +143,17 @@ import { useSettingsStore } from "@/store/settings";
138143import { useSubsStore } from " @/store/subs" ;
139144import { isMobile } from " @/utils/isMobile" ;
140145import { useRouter } from " vue-router" ;
146+ import { useAppNotifyStore } from " @/store/appNotify" ;
141147
148+ const { showNotify } = useAppNotifyStore ();
142149const router = useRouter ();
143150const props = defineProps <{
144151 data: Share ;
145152 disabled? : boolean ;
146153}>();
147154const emit = defineEmits ([" detail" , " delete" ]);
148-
155+ const { copy, isSupported } = useClipboard ();
156+ const { toClipboard : copyFallback } = useV3Clipboard ();
149157const { t } = useI18n ();
150158const { env } = useBackend ();
151159const scrollTop = 0 ;
@@ -246,6 +254,17 @@ const getOneShareOrigin = async (keyName: string) => {
246254 }
247255};
248256
257+ const onClickCopyLink = async () => {
258+ const url = getShareUrl ();
259+ console .log (' url' , url );
260+ if (isSupported ) {
261+ await copy (url );
262+ } else {
263+ await copyFallback (url );
264+ }
265+ showNotify ({ title: t (" sharePage.copyShare.succeedNotify" ) });
266+ };
267+
249268const onClickShareLink = async () => {
250269 try {
251270 const keyName = encodeURIComponent (name .value );
0 commit comments