2021-04-01 11:13:38 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div id="printRref">
|
|
|
|
|
<el-card shadow="hover" header="复制剪切演示">
|
|
|
|
|
<el-alert
|
2021-07-08 17:27:01 +08:00
|
|
|
|
title="感谢优秀的 `vue-clipboard3`,项目地址:https://github.com/JamieCurnow/vue-clipboard3`"
|
2021-04-01 11:13:38 +08:00
|
|
|
|
type="success"
|
|
|
|
|
:closable="false"
|
|
|
|
|
class="mb15"
|
|
|
|
|
></el-alert>
|
|
|
|
|
<el-input placeholder="请输入内容" v-model="copyVal">
|
|
|
|
|
<template #append>
|
2021-07-08 17:27:01 +08:00
|
|
|
|
<el-button @click="copyText(copyVal)">复制链接</el-button>
|
2021-04-01 11:13:38 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input placeholder="先点击上方 `复制链接` 按钮,然后 `Ctrl + V` 进行粘贴! " v-model="shearVal" class="mt15"> </el-input>
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-07-08 17:27:01 +08:00
|
|
|
|
import { reactive, toRefs, onMounted } from 'vue';
|
|
|
|
|
import commonFunction from '/@/utils/commonFunction.ts';
|
2021-04-01 11:13:38 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: 'funClipboard',
|
|
|
|
|
setup() {
|
2021-07-08 17:27:01 +08:00
|
|
|
|
const { copyText } = commonFunction();
|
2021-04-01 11:13:38 +08:00
|
|
|
|
const state = reactive({
|
|
|
|
|
copyVal: 'https://gitee.com/lyt-top/vue-next-admin',
|
|
|
|
|
shearVal: '',
|
|
|
|
|
});
|
|
|
|
|
// 页面加载时
|
2021-07-08 17:27:01 +08:00
|
|
|
|
onMounted(() => {});
|
2021-04-01 11:13:38 +08:00
|
|
|
|
return {
|
2021-07-08 17:27:01 +08:00
|
|
|
|
copyText,
|
2021-04-01 11:13:38 +08:00
|
|
|
|
...toRefs(state),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|