当前位置:网站首页>【无标题】
【无标题】
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边栏推荐
猜你喜欢

Kubernetes:(四)常用命令

【AutoSAR 七 工具链简介】

Is it safe to use the MD5 encrypted string to store the password?Hash algorithm you have to know
![[数学]线性代数复习总结](/img/21/daebbfc5b4fe99046eaded673f76a7.png)
[数学]线性代数复习总结

【体系结构 三 流水线技术】

MySQL 中的反斜杠 \\,怎么能这么坑?

Omni-channel e-commerce | How can well-known domestic cosmeceuticals seize the opportunity to achieve rapid growth?

LeetCode_474_ one and zero

万字总结:分布式系统的38个知识点

正则表达式
随机推荐
MATLAB程序设计与应用 2. 第2章 MATLAB数据及其运算 2.1 MATLAB数值数据 && 2.2 MATLAB矩阵的表示 && 2.3 变量及其操作
easyExce模板填充生成Excel的实际操作,多sheet页处理
线程的六种状态
尿素偶联Urea-siRNA Conjugates|Cyclodextrin-siRNA-β-CD环糊精修饰RNA核酸(解析说明)
LeetCode_474_一和零
scratch 编程 + 小学数学
震荡波病毒原代码(勒索病毒源代码)
Briefly talk about K-means clustering
朴素贝叶斯“朴素”在哪里?
海量数据查询方案mysql_Mysql海量数据存储和解决方案之二—-Mysql分表查询海量数据…[通俗易懂]
经验分享|编写简单易用的在线产品手册小妙招
JMeter tutorial (a)
cpolar应用实例之助力航运客户远程办公
The second growth curve | The driving guide for corporate innovation to break through the stagnation dilemma
悲伤的摇滚乐
【AutoSAR 九 C/S原理架构】
ds1302——斌哥51
藻酸盐/PEI/DNA复合载体|脂质-鱼精蛋白-DNA复合物|合成方法
PostgreSQL语句大全
Common power symbols meaning sharing