@meforma/vue-copy-to-clipboard

Vue.js 3 plugin to copy text to clipboard
16,239 12
Install
npm install @meforma/vue-copy-to-clipboard
Latest Version:0.0.1
License:MIT
Last Updated:Oct 10, 2023
Links: GitHub  ·  npm
Maintainer: jprodrigues70

Vue Copy To Clipboard

A simple vue 3 plugin to copy text to clipboard

Installation

# yarn
yarn add @meforma/vue-copy-to-clipboard

# npm
npm install @meforma/vue-copy-to-clipboard

Import

// In you main.js
// ... considering that your app creation is here
import copyText from "@meforma/vue-copy-to-clipboard";

createApp(App).use(copyText).mount("#app");

Usage

this.$copyText("Text to copy")
  .then(() => {
    console.log("copied!");
  })
  .catch(() => {
    console.log(`can't copy`);
  });

This plugin is compatible with browsers that can execute Clipboard API and browsers that can execute execCommand('copy'), alternatively.

License

MIT License

Related Packages

vue3-copy

This is fork from egoist/v-copy and now support Vue 3.

1,158 1
v-clipboard

Vue.js Clipboard Plugin

1,101,981 515
@scalar/use-clipboard

tiny wrapper around the clipboard API

37,211 16,304
vue-quill

Vue quill component and filter

54,840 120
@mooth/copy

copy text to clipboard from native select element

0

Version History

Version Released License
0.0.1 MIT