<template>
<div class="wrapper">
<el-input v-model="Name1" id="refUrlName" class="input-readonly"></el-input>
<el-button @click="clickCopyFun">复制111</el-button>
<el-input v-model="Name2" id="idUrlName" class="input-readonly"></el-input>
<el-button @click="jsFun('idUrlName')">复制222</el-button>
</div>
</template>
<script>
export default {
name: "Table",
components: {},
data() {
return {
Name1: "",
Name2: "",
};
},
methods: {
jsFun(id) {
const data = document.getElementById(id).value;
js 复制粘贴2中方法使用
于 2022-07-15 16:27:04 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)