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;
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章