fix:保存模板部分浏览器出现堆栈超出的情况,降低一下截图图片质量

This commit is contained in:
wangjiahao 2021-07-12 17:50:33 +08:00
parent b682063992
commit 4151f17609

View File

@ -131,7 +131,7 @@ export default {
saveToTemplate() {
this.templateSaveShow = true
html2canvas(this.$refs.imageWrapper).then(canvas => {
const snapshot = canvas.toDataURL('image/jpeg', 0.2) // 0.2
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2
if (snapshot !== '') {
this.templateInfo = {
name: this.$store.state.panel.panelInfo.name,
@ -149,7 +149,7 @@ export default {
},
downloadToTemplate() {
html2canvas(this.$refs.imageWrapper).then(canvas => {
const snapshot = canvas.toDataURL('image/jpeg', 0.2) // 0.2
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2
if (snapshot !== '') {
this.templateInfo = {
name: this.$store.state.panel.panelInfo.name,
@ -167,7 +167,7 @@ export default {
refreshTemplateInfo() {
this.templateInfo = {}
html2canvas(this.$refs.imageWrapper).then(canvas => {
const snapshot = canvas.toDataURL('image/jpeg', 0.2) // 0.2
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2
if (snapshot !== '') {
this.templateInfo = {
snapshot: snapshot,