src/utils/utis.js
@@ -264,4 +264,18 @@ export const handleImage = (url) => { return new URL(url, import.meta.url).href } } // 字符串转数组 export const strToArr = (str, separator = ',') => { if (typeof str !== 'string') return []; return str.split(separator); } // 清除所有定时器 export const clearAllTimers = () => { let highestTimeoutId = setTimeout(() => {}, 0); for (let i = 0; i <= highestTimeoutId; i++) { clearTimeout(i); clearInterval(i); } }