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.
15 lines
392 B
15 lines
392 B
import Vue from 'vue' |
|
import Clipboard from 'clipboard' |
|
|
|
export default function (event) { |
|
const clipboard = new Clipboard(event.target) |
|
clipboard.on('success', () => { |
|
Vue.prototype.$message.success('复制成功') |
|
clipboard.destroy() |
|
}) |
|
clipboard.on('error', () => { |
|
Vue.prototype.$message.error('复制失败') |
|
clipboard.destroy() |
|
}) |
|
clipboard.onClick(event) |
|
}
|
|
|