Skip to content

Commit

Permalink
Test: for reproduce bug of dom-to-image-more
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Apr 1, 2024
1 parent 555cba7 commit 0c0a411
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const routes = [
{
path: '/dom-to-image',
name: 'domToImage',
meta: { description: 'dom-to-image vs dom-to-image more' },
meta: { description: 'dom-to-image vs dom-to-image-more' },
component: () => import(/* webpackChunkName: "domToImage" */ '@/views/dom-to-image'),
},
{
Expand Down
19 changes: 10 additions & 9 deletions src/views/dom-to-image.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- dom-to-image vs dom-to-image more -->
<!-- dom-to-image vs dom-to-image-more -->
<template>
<div>
<h2>dom-to-image vs dom-to-image more</h2>
<h2>dom-to-image vs dom-to-image-more</h2>
<p>
Select a PNG image 👇
<el-link type="primary" :href="srcUrl" style="margin-left: 13rem;">view source</el-link>
Expand Down Expand Up @@ -48,13 +48,14 @@ export default {
})
},
handleDownload2() {
domtoimagemore.toPng(document.querySelector('img.preview'))
.then((dataUrl) => {
const link = document.createElement('a')
link.download = 'preview-more.png'
link.href = dataUrl
link.click()
})
domtoimagemore.toPng(document.querySelector('img.preview'), {
cacheBust: true
}).then((dataUrl) => {
const link = document.createElement('a')
link.download = 'preview-more.png'
link.href = dataUrl
link.click()
})
}
},
}
Expand Down

0 comments on commit 0c0a411

Please sign in to comment.