Vue.js開發筆記

1、去掉訪問url中的"#"

修改main.js文件,添加mode: 'history'

const RouterConfig = {
  mode: 'history',
  routes: MainRoute
}

const router = new VueRouter(RouterConfig)

2、vue項目build後發佈的nginx的404問題

修改nginx配置文件
location / {
        root   /usr/share/nginx/html;
        try_files $uri $uri/ /index.html$is_args$args; ##添加這行
        index  index.html index.htm;
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章