vcopy

0.0.1 • Public • Published

Vcopy

A simple vue plugin use for copy.

npm i vcopy --save

import Vue from 'vue'
import vcopy from 'vcopy'

Vue.use(vcopy, {
  // directive name
  name: 'copy',
  // success tip
  success: function () {
    alert('copy success')
  },
  // failure tip
  failure: function () {
    alert('copy failure')
  },
  // format copy content
  formater: function (v) {
    return String(v)
  }
})

<template>
  <div id="app">
    <textarea v-model="msg"></textarea>
    <button v-copy="msg">COPY</button>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
      msg: 'Welcome to Your'
    }
  }
}
</script>

Readme

Keywords

Package Sidebar

Install

npm i vcopy

Weekly Downloads

1

Version

0.0.1

License

ISC

Last publish

Collaborators

  • kinglisky