v-copy

Vue directive to copy to clipboard.

  • v-copy

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
v-copy
8830.1.05 years ago5 years agoMinified + gzip package size for v-copy in KB

Readme

v-copy
Vue directive to copy to clipboard.

Install

yarn add v-copy

CDN: UNPKG | jsDelivr (It's automatically installed as global directive v-copy in CDN)

Usage

First register the directive globally:
import Copy from 'v-copy'

Vue.use(Copy)

Or locally:
import { copy } from 'v-copy'

export default {
  directives: {
    copy
  }
}

Then use it in template:
<template>
  <button v-copy="`some text`">Copy!</button>
</template>

Browser support

This supports what copy-text-to-clipboard supports, namely ever-green browsers and IE9+. (Not all are carefully tested though :P)

License

MIT © EGOIST