spotifyplaylistarchive.com/composables/canCopyToClipboard.ts

13 lines
337 B
TypeScript
Raw Normal View History

2022-09-03 16:29:38 +02:00
const { isSupported } = useClipboard();
const clipboardWirtePermission = usePermission('clipboard-write');
const canCopyToClipboard = computed(
() => isSupported.value && clipboardWirtePermission.value === 'granted'
);
export const useCanCopyToClipboard = () => ({
isSupported,
clipboardWirtePermission,
canCopyToClipboard
});