动态引入图片路径写法

<el-image
              style="width: 16px; height: 16px"
              :src="getAssetsImg(item.unitGrade)"
              class="mr5"
            />
const getAssetsImg = (type?: string) => {
  return new URL(`/src/assets/image/fx_${type}.png`, import.meta.url).href
}

posted @ 2025-11-07 09:20  sinceForever  阅读(10)  评论(0)    收藏  举报