Files
intc-vue3/src/utils/require.js
2024-04-19 09:36:13 +08:00

10 lines
243 B
JavaScript

/** vite的特殊性, 需要处理图片 */
export const require = (imgPath) => {
try {
const handlePath = imgPath.replace('@', '..')
return new URL(handlePath, import.meta.url).href
} catch (error) {
console.warn(error)
}
}