fix: svg load check

This commit is contained in:
ShawnPhang 2023-09-19 17:22:08 +08:00
parent de233e92dc
commit d3f9b195bd
2 changed files with 6 additions and 6 deletions

View File

@ -2,8 +2,8 @@
* @Author: ShawnPhang * @Author: ShawnPhang
* @Date: 2021-12-24 15:13:58 * @Date: 2021-12-24 15:13:58
* @Description: * @Description:
* @LastEditors: ShawnPhang <site: book.palxp.com> * @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2023-07-17 14:25:53 * @LastEditTime: 2023-09-19 17:19:07
*/ */
export default class PreLoad { export default class PreLoad {
private i: number private i: number

View File

@ -71,16 +71,16 @@ export default defineComponent({
} }
// svg // svg
try { try {
if (item.imgUrl && !item.isNinePatch) { if (item.svgUrl && item.type === 'w-svg') {
const cNodes: any = (window as any).document.getElementById(item.uuid).childNodes
svgsData.push(cNodes)
} else if (item.imgUrl && !item.isNinePatch) {
const cNodes: any = (window as any).document.getElementById(item.uuid).childNodes const cNodes: any = (window as any).document.getElementById(item.uuid).childNodes
for (const el of cNodes) { for (const el of cNodes) {
if (el.className && el.className.includes('img__box')) { if (el.className && el.className.includes('img__box')) {
imgsData.push(el.firstChild) imgsData.push(el.firstChild)
} }
} }
} else if (item.svgUrl) {
const cNodes: any = (window as any).document.getElementById(item.uuid).childNodes
svgsData.push(cNodes)
} }
} catch (e) {} } catch (e) {}
}) })