chore: 去除生成预览图时的标尺

This commit is contained in:
奔跑的面条
2022-05-28 17:58:07 +08:00
parent 79a2b98a1a
commit 9fae683d8b
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -116,8 +116,14 @@ export const useSync = () => {
// 获取缩略图片
const range = document.querySelector('.go-edit-range') as HTMLElement
const ruler = document.getElementById('mb-ruler')
// 去除标尺Dom
if (ruler) ruler.style.display = 'none'
// 生成图片
const canvasImage: HTMLCanvasElement = await html2canvas(range)
// 还原标尺
if (ruler) ruler.style.display = 'block'
// 上传预览图
let uploadParams = new FormData()
uploadParams.append('object', base64toFile(canvasImage.toDataURL(), `${fetchRouteParamsLocation()}_index_preview.png`))