mirror of
https://github.com/xxxsf/vue3-h5-template.git
synced 2025-06-10 09:29:20 +08:00
pay attention in prod
This commit is contained in:
parent
070538f650
commit
5f39f4a6d6
21
README.md
21
README.md
@ -90,6 +90,27 @@ const app = new Vue({
|
||||
// 现在,应用已经启动了!
|
||||
```
|
||||
|
||||
# 实际应用中需要注意的地方:
|
||||
|
||||
> 1、生成环境下若项目不是放在服务器的根目录下会访问不到静态资源,此时,你只需要修改下config文件夹内index.js的build中的assetsPublicPath即可
|
||||
|
||||
```
|
||||
before:
|
||||
assetsPublicPath: '/',
|
||||
|
||||
after:
|
||||
assetsPublicPath: '/wx/otherPath/static',
|
||||
```
|
||||
|
||||
> 2、在写静态资源的时候最好使用相对路径,如:
|
||||
```
|
||||
error:
|
||||
background: url(../assets/img/icon.png);
|
||||
|
||||
right:
|
||||
background: url(./../assets/img/icon.png);
|
||||
```
|
||||
|
||||
# Reference Articles
|
||||
* [Vue-Router](http://router.vuejs.org/zh-cn/essentials/getting-started.html)
|
||||
* [ECMAScript 6入门](http://es6.ruanyifeng.com/)
|
||||
|
Loading…
x
Reference in New Issue
Block a user