标签:err imp ima 失败 class size his clip 引入
安装:
1 npm install --save vue-clipboard2
在main.js中引入
1 import VueClipboard from ‘vue-clipboard2‘; 2 Vue.use(VueClipboard);
例子:
1 <div> 2 <span class="key-box">{{ key }}</span> 3 <el-button class="but" 4 type="primary" 5 size="small" 6 v-clipboard:copy="key" 7 v-clipboard:success="onCopy" 8 v-clipboard:error="onError">复制</el-button> 9 </div>
1 onCopy() { 2 this.$message({ 3 message: ‘复制成功‘, 4 type: ‘success‘ 5 }); 6 }, 7 onError() { 8 this.$message.error(‘复制失败‘); 9 }
标签:err imp ima 失败 class size his clip 引入
原文地址:https://www.cnblogs.com/tanweiwei/p/13064725.html