1.img src路径
<img src="./assets/img/title.png" />
说明:图片需要放在assets文件夹下
2.img 设置统一前缀
<img :src="imgAddfun('title.png')" />
main.js中设置统一前缀
Vue.prototype.imgAddfun = (address)=>{return require(`./assets/img/${address}`)}
3.img 设置动态路径
<img :src="sAudioOnImg"> sAudioOnImg: this.isAudioOn? require("../../assets/img/closevoice.png"): require("../../assets/img/mic-off.png"),
说明:src为动态路径时,变量需要使用requere()来获取图片路径