Bootstrap

vue 3 动态引入图片

	// vue3 代替使用reqire 引入图片
	// ps. 图片是自己项目中的已引入的图片
	1const getAssetsImages = (name) => {
    return new URL(`/src/assets/images/icon/${name}.png`, import.meta.url).href
  }
  2// 应用数据
const application = reactive([
  { title: '预约带看', icon: 'yuyue', link: '' },
  { title: '仪表门锁', icon: 'yibiao', link: '' },
  { title: '审批', icon: 'shenpi', link: '' },
  { title: '报修反馈', icon: 'baoxiu', link: '' },
  { title: '自定义', icon: 'zidingyi', link: '' },
]);
const pathImage = () => {
  for (let i = 0; i < application.length; i++) {
    import(`./../../static/suzhou-images/icon/${application[i].icon}.png`).then((res :any) => {
      application[i].icon = res.default;
    })
  }
};```

;