更改历史
* 2018-10-29 高天阳 初始化文档
npm install --save vue-clipboard2
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
<script src="vue.min.js"></script>
<!-- 必须在vue.js之后放置这一行 -->
<script src="vue-clipboard.min.js"></script>
<template>
<div class="wxsmallcode-page publicCon">
<div class="copyBox">
sysAppId:<span>{{sysAppIds}}</span>
<el-button class="ml10" type="text" size="medium"
v-clipboard:copy="sysAppIds"
v-clipboard:success="onCopy"
v-clipboard:error="onError">点击复制</el-button>
</div>
</template>
<script>
export default {
data(){
return {
sysAppIds: 'xxxxxxxxxxxsx'
}
},
methods: {
// 复制成功
onCopy(e){
console.log(e);
},
// 复制失败
onError(e){
alert("失败");
},
}
}
</script>