在页面中引用图片,打包后发现图片地址不对,
解决办法,把图片放在public文件夹下方,在页面通过import导入,这样打包地址才对
<van-image height="100%" :src='imgUrl' />
import myImage from "/img/logo.png";
export default {
name: "App",
data() {
return {
active: 0,
imgUrl: myImage,
};
},