1、在template的img中直接引入相对路径
<img src="../../static/img/car.png" />
2、使用v-bind绑定src路径,不会被webpack处理,因此需要使用require手动引入

3、在script中的方法中要引入图片时,直接根据打包后的相对路径引入(./static/img/图片),或使用require引入

4、引入iframe,打包后文件不在根目录引起的iframe路径问题,在这里引入时,直接使用编译或打包后的路径即可(./static/iframe/index.html)

网友评论