刷新页面时找不到vue3路由nginx服务器页面(404)

时间:2021-05-21 06:54:15

标签: javascript vue.js nginx

我在 nginx 上包含了这个,刷新页面时路由仍然不起作用

nginx:

location / {
  try_files $uri $uri/ /index.html;
}

路由(vue):

const routes = [
  {
    path: '/',
    name: 'Access',
    component: () => import('@/views/Access'),
    meta: {
      guest: true
    }
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

0 个答案:

没有答案
相关问题