10 lines
243 B
JavaScript
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)
|
|
}
|
|
}
|