vue剪切板功能
使用 vue-clipboard2
安装:使用下面的方式或者在package.json中配置好后 直接npm install
npm install --save vue-clipboard2
在main.js中配置:
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
vue页面中使用:
<template slot-scope="scope">
<el-button
type="text" size="mini"
v-clipboard:copy="scope.row.name"
v-clipboard:success="copySuccess"
v-clipboard:error="onError">
复制测点ID
</el-button>
</template>
copySuccess(e) {
this.$message({
type: 'success',
message: '复制测点ID成功!'
});
},
onError(e) {
this.$message({
type: 'error',
message: '复制测点ID失败!'
});
},
- 上一篇 »python获取剪切板的内容
- 下一篇 »python自动化操作——复制文件到剪切板发送微信