更换贺报下载的方法10

This commit is contained in:
xuxingjun
2024-12-25 18:00:12 +08:00
parent 30f42c3a3c
commit 4b7ab5acfc
2 changed files with 15 additions and 6 deletions

View File

@@ -255,11 +255,12 @@
@cancel="cancelChange"
/>
</van-popup>
<div class="hebao" v-if="hebaoShow">
<!-- <div class="hebao" > -->
<generateImg
v-if="hebaoShow"
@child-colse="closeHebao"
></generateImg>
</div>
<!-- </div> -->
<van-popup v-model="xiangqingShow" position="right" :style="{ width: '100%', height: '100%' }">
<policyDetails
v-if="xiangqingShow"

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="contents">
<div id="capture" ref="generateImg" style="height: 100vh; overflow: hidden">
<img src="@/assets/images/list_img.png" alt="" />
<div class="box">
@@ -182,9 +182,9 @@ export default {
console.log(2222);
// 使用 html2canvas 捕获图像,并等待其完成
const canvas = await html2canvas(this.$refs.generateImg, {
width: this.$refs.generateImg.offsetWidth,
height: this.$refs.generateImg.offsetHeight,
const canvas = await html2canvas(domElement, {
width: domElement.offsetWidth,
height: domElement.offsetHeight,
backgroundColor: '#fff',
scale: 1,
dpi: 300
@@ -255,6 +255,14 @@ export default {
</script>
<style lang="scss" scoped>
.contents {
width: 100%;
height: 100vh;
background-color: #fff;
position: fixed;
top: 0;
left: 0;
}
img {
height: 100%;
width: 100%;