Socket
Socket
Sign inDemoInstall

@meforma/vue-copy-to-clipboard

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @meforma/vue-copy-to-clipboard

Vue.js 3 plugin to copy text to clipboard


Version published
Weekly downloads
200
increased by8.11%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 28 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc