@uone/u-clip

1.1.0 • Public • Published

test-copied

说明:文本复制

兼容性:支持Chrome42+, edge12+, IE9+, Firefox41+, Opera29+, Safari10+
main引入:

const Clipboard = require('clipboard')

Example

<template>
    <button class="btn" data-clipboard-text="我是复制的文本" @click="handleCopy">
        点我复制
    </button>
</template>

<script>
export default {
  name: 'App',
  methods: {
    handleCopy () {
        let clipboard = new Clipboard(".btn")
        clipboard.on('success', () => {
            console.log('复制成功')
        })
        clipboard.on('error', () => {
            console.log('复制失败')
        })
    }
  }
}
</script>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.01latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.01

Package Sidebar

Install

npm i @uone/u-clip

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

35.6 kB

Total Files

4

Last publish

Collaborators

  • uone