|
|
@ -15,9 +15,13 @@ export const useCopy = () => { |
|
|
|
const { copy: _copy, isSupported } = useClipboard() |
|
|
|
const { copy: _copy, isSupported } = useClipboard() |
|
|
|
|
|
|
|
|
|
|
|
const copy = async (text: string) => { |
|
|
|
const copy = async (text: string) => { |
|
|
|
if (isSupported.value) { |
|
|
|
try { |
|
|
|
await _copy(text) |
|
|
|
if (isSupported.value) { |
|
|
|
} else { |
|
|
|
await _copy(text) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
copyFallback(text) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
copyFallback(text) |
|
|
|
copyFallback(text) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|