1.0.5 • Published 4 years ago

test-copied v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

test-copied

说明:文本复制
兼容性:支持Chrome42+, edge12+, IE9+, Firefox41+, Opera29+, Safari10+
main引入:
import clipboard from 'test-copied'
Vue.prototype.clipboard = clipboard

Example

<template>
  <div id="app">
    <button class="btn" :data-clipboard-text="testVal" @click="copyLink">
        点我复制
    </button>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
        testVal: '这是要复制的文本内容'
    }
  },
  methods: {
   copyLink () {
     let clipboard = new this.clipboard(".btn")
     clipboard.on('success', function () {
       alert('复制成功')
     })
     clipboard.on('error', function () {
       alert('复制失败')
     })
   }
  }
}
</script>
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago