PixelAI-admin/src/views/fun/clipboard/index.vue

40 lines
1.1 KiB
Vue
Raw Normal View History

<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`"
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>
</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';
export default {
name: 'funClipboard',
setup() {
2021-07-08 17:27:01 +08:00
const { copyText } = commonFunction();
const state = reactive({
copyVal: 'https://gitee.com/lyt-top/vue-next-admin',
shearVal: '',
});
// 页面加载时
2021-07-08 17:27:01 +08:00
onMounted(() => {});
return {
2021-07-08 17:27:01 +08:00
copyText,
...toRefs(state),
};
},
};
</script>