emplate里面的内容 node会解析 ../assets/logo.png 这句话在node会当成普通的字符串 而编译后的开发环境是找不到对应的地址的 style="background:url(../assets/logo.png)" 解决方案需要使用node的require方法,把相对路径转成node解析后的地址 这个路径是脚手架 打包后的图片的地址 background: url("/img/logo.82b9c7a5.png") no-repeat; 是开发环境中打包编译出来的,实际上没有img这个文件 --> :style="{background:'url('+imgurl+') no-repeat'}" 图片在根路径下这样写是可以被识别的 style="background:url(/images/logo.png) no-repeat"