更换贺报下载的方法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" @cancel="cancelChange"
/> />
</van-popup> </van-popup>
<div class="hebao" v-if="hebaoShow"> <!-- <div class="hebao" > -->
<generateImg <generateImg
v-if="hebaoShow"
@child-colse="closeHebao" @child-colse="closeHebao"
></generateImg> ></generateImg>
</div> <!-- </div> -->
<van-popup v-model="xiangqingShow" position="right" :style="{ width: '100%', height: '100%' }"> <van-popup v-model="xiangqingShow" position="right" :style="{ width: '100%', height: '100%' }">
<policyDetails <policyDetails
v-if="xiangqingShow" v-if="xiangqingShow"

View File

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