@meforma/vue-copy-to-clipboard

0.0.1 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.1513latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.1513

Package Sidebar

Install

npm i @meforma/vue-copy-to-clipboard

Weekly Downloads

410

Version

0.0.1

License

MIT

Unpacked Size

3.32 kB

Total Files

4

Last publish

Collaborators

  • jprodrigues70