在vue3.0 中如何写import的图片
<template>
<img
:src="getImgUrl(`2xl-${src}`)"
/>
</template>
setup
function getImgUrl(img) {
return new URL(`/@/assets/images/header/${img}.png`, import.meta.url).href;
}
在vue3.0 中如何写import的图片
<template>
<img
:src="getImgUrl(`2xl-${src}`)"
/>
</template>
setup
function getImgUrl(img) {
return new URL(`/@/assets/images/header/${img}.png`, import.meta.url).href;
}