diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue index 2495908..b6a233a 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue @@ -118,7 +118,7 @@ import { Search } from '@element-plus/icons-vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { useRouter, useRoute } from 'vue-router' -import html2canvas from 'html2canvas'; +// import html2canvas from 'html2canvas'; import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork' import { listEvaluationclue } from '@/api/classTask' @@ -453,13 +453,16 @@ const handleDelete = async(item, index) => { */ const captureScreenshot = (id) => { const targetElement = document.getElementById('screenshot-target-' + id); - html2canvas(targetElement).then(canvas => { - // 将canvas转换为图像URL - const screenshotUrl = canvas.toDataURL('image/png'); - // 在这里可以将截图保存到本地或上传到服务器 - // console.log(screenshotUrl); - emit('addQuizImgBs64', screenshotUrl); - }); + if (targetElement) { + emit('addQuizImgBs64', targetElement); + } + // html2canvas(targetElement).then(canvas => { + // // 将canvas转换为图像URL + // const screenshotUrl = canvas.toDataURL('image/png'); + // // 在这里可以将截图保存到本地或上传到服务器 + // // console.log(screenshotUrl); + // emit('addQuizImgBs64', screenshotUrl); + // }); } // 防抖