当前位置:网站首页>【无标题】
【无标题】
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
边栏推荐
- Is Apifox free?Completely free, unlimited team size, unlimited functions
- 图床软件要收费,算了我自己写一个开源免费的。
- Agile Organization | The path for enterprises to overcome the impact of the digital wave
- LOG4J Learning
- 荣耀的野望:智慧世界的“高端平民”
- mysql get field comments and get table fields
- Common power symbols meaning sharing
- 程序员如何提升自己写代码的能力?
- 【AutoSAR 四 BSW概述】
- ACM学习书籍简介
猜你喜欢
【Autosar vLinkGen 链接器脚本生成器】
直播预约 | 如何通过MLOps解放和提升AI生产力?
MSNs-SS-siRNA二氧化硅-二硫键-核酸RNA|HA-SS-siRNA,hyaluronic acid透明质酸修饰RNA(RNA修饰剂)
[mathematical foundation] probability and mathematical statistics related concept learning
数据可视化----网页显示温湿度
敏捷组织 | 企业克服数字化浪潮冲击的路径
全渠道电商 | 国内知名的药妆要如何抓住风口实现快速增长?
Is Apifox free?Completely free, unlimited team size, unlimited functions
LeetCode 1047 Remove all adjacent duplicates in a string
Single-core browser and what is the difference between dual-core browser, which to use?
随机推荐
ESP8266-Arduino编程实例-I2C设备地址扫描
12437字,带你深入探究RPC通讯原理
[数学]线性代数复习总结
EasyExce template filling generation of Excel of actual operation, many processing sheet page
简单说说K均值聚类
双功能RGD-TAT修饰DNA纳米胶束|聚苯胺纳米线修饰DNA(PAINW/DNA)
Safe Browser will have these hidden features that will let you play around with your browser
Common power symbols meaning sharing
【AutoSAR 九 C/S原理架构】
模拟量、数字量与开关量的区别
[数学基础]概率论与数理统计相关概念学习
图床软件要收费,算了我自己写一个开源免费的。
[数学]考研数学公式定理大总结
使用IDEA连接mysql
【AutoSAR 一 概述】
SAG1-MIC8复合DNA基因疫苗|新型脂质-HAP-DNA复合体|实验要求
MSNs-SS-siRNA二氧化硅-二硫键-核酸RNA|HA-SS-siRNA,hyaluronic acid透明质酸修饰RNA(RNA修饰剂)
R语言对airbnb数据nlp文本挖掘、地理、词云可视化、回归GAM模型、交叉验证分析
scratch 编程 + 小学数学
ACM study book introduction