Skip to content

Commit ed5fbef

Browse files
committed
ADD: BASE_URL on mode
1 parent 02c349f commit ed5fbef

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
VITE_BASE=/

.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
VITE_BASE=/vue-bootstrap

src/router/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import { createRouter, createWebHistory } from "vue-router";
22

3+
const baseUrl = import.meta.env.BASE_URL;
4+
35
export const routes = [
46
{
5-
path: "/",
7+
path: `${baseUrl}`,
68
component: () => import("@/layouts/Default.vue"),
79
children: [
810
{ path: "", name: "Home", component: () => import("@/views/Home.vue") }
911
],
1012
},
1113
{
12-
path: "/about",
14+
path: `${baseUrl}about`,
1315
component: () => import("@/layouts/Page.vue"),
1416
children: [
1517
{ path: "", name: "About", component: () => import("@/views/About.vue") }
1618
],
1719
},
1820
{
19-
path: "/contacts",
21+
path: `${baseUrl}contacts`,
2022
component: () => import("@/layouts/Page.vue"),
2123
children: [
2224
{ path: "", name: "Contacts", component: () => import("@/views/Contacts.vue") },

0 commit comments

Comments
 (0)