1.vue本地打包并部署到服务器上
1.1.在config(文件夹)—>index.js中,添加(如图的红色标记区域)
1.2.在build(文件夹)—>utils.js添加
示例
存放在static文件夹里:
img标签引入图片(请忽略 ’ )
<img’ src="…/…/static/img/moon.png" class=“test-img” />
css图片使用
background: url(’…/…/static/img/moon.png’) no-repeat top left ;
1.3执行打包命令
npm run build
2.vue的this.router.go(0)对ios无效,可适用window.location.reload;