路由使用history模式配置

2022-02-22  本文已影响0人  sunowter

域名例如:www.hh.com/test/

1、const router = new VueRouter({

  mode: "history",

  base: test,

});

 2、vue.config中

 publicPath: test

3、nginx:

location / {

            alias  /root_path/

            index index.html index.htm;

            try_files $uri $uri/ @router;

                }

        location @router{

                rewrite ^(.+)$ test/index.html last;

        }

上一篇 下一篇

猜你喜欢

热点阅读