隐藏清除svga容器
This commit is contained in:
@@ -501,7 +501,7 @@ export default {
|
||||
});
|
||||
|
||||
const tableData = ref([]);
|
||||
const total = ref(10); // 总页数
|
||||
const total = ref(0); // 总页数
|
||||
const currentPage = ref(1); // 页码
|
||||
const pageSize = ref(10); // 条数
|
||||
|
||||
@@ -630,11 +630,10 @@ export default {
|
||||
const selectedFile = files.raw;
|
||||
if (!selectedFile) return;
|
||||
// 清除旧的预览数据
|
||||
resetFile();
|
||||
// resetFile();
|
||||
const fileType = selectedFile.type;
|
||||
const fileName = selectedFile.name;
|
||||
// 创建预览 URL
|
||||
console.log(res, 22222222222222222);
|
||||
filePreview.value = res.data;
|
||||
file.value = selectedFile;
|
||||
// 根据文件类型判断
|
||||
@@ -653,18 +652,20 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
const resetFile = () => {
|
||||
file.value = null;
|
||||
filePreview.value = null;
|
||||
isImage.value = false;
|
||||
isVideo.value = false;
|
||||
isSVGA.value = false;
|
||||
// 清除 SVGA 容器内容
|
||||
const svgaPlayer = document.getElementById("svga-player");
|
||||
if (svgaPlayer) {
|
||||
svgaPlayer.innerHTML = "";
|
||||
}
|
||||
};
|
||||
// const resetFile = () => {
|
||||
// nextTick(() => {
|
||||
// file.value = null;
|
||||
// filePreview.value = null;
|
||||
// isImage.value = false;
|
||||
// isVideo.value = false;
|
||||
// isSVGA.value = false;
|
||||
// // 清除 SVGA 容器内容
|
||||
// const svgaPlayer = document.getElementById("svga-player");
|
||||
// if (svgaPlayer) {
|
||||
// svgaPlayer.innerHTML = "";
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
const initSVGA = (url) => {
|
||||
nextTick(() => {
|
||||
@@ -739,7 +740,7 @@ export default {
|
||||
handleAvatarError,
|
||||
handleAvatarSuccess,
|
||||
handleAvatarSuccess1,
|
||||
resetFile,
|
||||
// resetFile,
|
||||
initSVGA,
|
||||
initSVGAList,
|
||||
jsonFun,
|
||||
|
Reference in New Issue
Block a user