You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
332 B
12 lines
332 B
import { message } from 'ant-design-vue'
|
|
|
|
export function copyText(text: string, prompt: string | null = '已成功复制到剪切板!') {
|
|
navigator.clipboard.writeText(text).then(
|
|
() => {
|
|
prompt && message.success(prompt)
|
|
},
|
|
(error: Error) => {
|
|
message.error(`复制失败!${error.message}`)
|
|
},
|
|
)
|
|
}
|
|
|