惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

博客园 - 赵瑛

如何把一个js的代码变成一个.min.js的文件 thinkphp8有一个木马文件链接 thinkphp 可以居中的分页css样式 thinkphp8无法显示验证码的原因之一 php将内容转为word vue简单分页 vue无限加载 mpdf增加字体并进行使用 jquery导出word css清除浮动最好的方法 Elasticsearch同时实现and与or查询 Elasticsearch查询指定字段是否有重复数据 查询并删除Elasticsearch库中指定字段重复的数据 elasticsearch进行and,or多条件组合查询 elasticsearch中的and和or php FTP操作类( 拷贝、移动、删除文件/创建目录 ) mysql重置自增id js 双指放大、拖动图片 php操作elasticsearch数据库的方法
vue点击复制
赵瑛 · 2024-07-11 · via 博客园 - 赵瑛
<script>
    // 创建Vue实例
    Vue.createApp({
        methods: {
            // 定义handleClick方法
            handleClick() {
                alert('按钮被点击了!');
            },
            copyOrderId2(orderId) {
                var input = document.createElement("input"); // 创建input对象
                input.value = orderId; // 设置复制内容
                document.body.appendChild(input); // 添加临时实例
                input.select(); // 选择实例内容
                document.execCommand("Copy"); // 执行复制
                document.body.removeChild(input); // 删除临时实例
                alert('复制成功!');
            },
        },

    }).mount('#app'); // 将Vue实例挂载到#app元素上
</script>
<span @click="copyOrderId2('12121221212')">
点击复制
</span>

posted @ 2024-07-11 16:15  赵瑛  阅读(50)  评论()    收藏  举报