当前位置:网站首页>【无标题】
【无标题】
2022-07-29 19:49:00 【无围之解】
1 引入依赖
npm install html2canvas jspdf --save
(jspdf导出卫pdf格式)
2使用
<el-button @click="clickToImg">生成海报图片</el-button>
<div ref="imageWrapper">
<button @click="clickAbout">About</button> |
<button @click="clicktest">test</button> |
<button @click="clickprofile">profile</button> |
<button @click="clickposts">posts</button> |
</div>
3页面引入 因为用的少,不全局引用 那个页面用加载即可
import html2canvas from "html2canvas"
4,方法调用
clickToImg(){
const opts = {
scale: 2, // 添加的scale 参数 提交图片清晰度,还有其他参数
useCORS: true // 【重要】开启跨域配置
};
html2canvas(this.$refs.imageWrapper边栏推荐
- [mathematical foundation] probability and mathematical statistics related concept learning
- 解决宝塔mysql 远程root 无法连接问题
- PEG-siRNA-PCL|siRNA-PEG-LHRH|MPEG-siRNA 甲氧基聚乙二醇修饰核酸
- 聚丙烯微孔膜的等离子体改性及DNA|有机自由基改性DNA-阳离子脂质复合体的应用
- C language learning books zero-based introductory articles
- 华为笔记本键盘锁住了(笔记本电脑键盘怎么亮起来)
- [数学]线性代数复习总结
- 如何把thinkphp5的项目迁移到阿里云函数计算来应对流量洪峰?
- 接口测试工具之Postman详解
- Is Apifox free?Completely free, unlimited team size, unlimited functions
猜你喜欢

Build your own image search system (1): 10 lines of code to search images by image

一道菜撑起百亿估值的太二酸菜鱼,能否迈过食品安全这道坎?

easyExce模板填充生成Excel的实际操作,多sheet页处理

siRNA-S-S-PEG-LMWP|M-MSN-siRNA介孔二氧化硅修饰RNA(齐岳RNA功能化修饰)
![[数学]考研数学公式定理大总结](/img/7b/4eee16f4dcaa3d9ca76ccdbc2e1166.png)
[数学]考研数学公式定理大总结

【AutoSAR 四 BSW概述】

JMeter tutorial (a)

Is Apifox free?Completely free, unlimited team size, unlimited functions
![[GXYCTF2019]禁止套娃](/img/91/3f64bebd13a8b13fbb387c2acf8618.png)
[GXYCTF2019]禁止套娃

【AutoSAR 十三 NVM】
随机推荐
Kubernetes: (4) Common commands
Agile Organization | The path for enterprises to overcome the impact of the digital wave
SAG1-MIC8复合DNA基因疫苗|新型脂质-HAP-DNA复合体|实验要求
找工作那些事-和表弟的一次聊天
双功能RGD-TAT修饰DNA纳米胶束|聚苯胺纳米线修饰DNA(PAINW/DNA)
LeetCode #88.合并两个有序数组
PostgreSQL语句大全
ESP8266-Arduino programming example-I2C device address scan
[mathematical foundation] higher mathematics concept learning
藻酸盐/PEI/DNA复合载体|脂质-鱼精蛋白-DNA复合物|合成方法
Is it safe to use the MD5 encrypted string to store the password?Hash algorithm you have to know
scratch学习相关资料汇总
[数学基础]高等数学相关概念学习
经验分享|编写简单易用的在线产品手册小妙招
核壳二氧化钛纳米颗粒修饰DNA|二氢杨梅素修饰DNA药物|相关介绍
数据可视化----网页显示温湿度
JMeter tutorial (a)
internship:利用easypoi将excel表数据导入导出
PyQt5快速开发与实战 7.2 信号与槽再细分 && 7.3 信号与槽的高级玩法
[数学基础]线性代数相关概念学习