import { onUnmounted } from 'vue';
import ClipboardJS from 'clipboard';
/**
 * 复制文本
 */
export function useCopy(_class = '.im-copy-btn') {
  const clipboard = new ClipboardJS(_class);
  clipboard.on('success', (e) => {
    $msg({type: 'success', message: '已复制到剪切板！'});
  });
  onUnmounted(() => {
    clipboard.destroy();
  });
}
