vue 使用canvas时new image() img.src 图片地址加载失败

业务场景:vue项目中使用 

const img = new Image()

 img.src =  '@/static/images/bgimg1.jpg' 加载图片路径失败

img.src = require('@/static/images/bgimg1.jpg') 加载成功
 
使用require
posted @ 2023-01-12 10:27  zhangPooo  阅读(598)  评论(0编辑  收藏  举报