Skip to content

Commit 235374a

Browse files
committed
Vue router fixes
1 parent 9faee64 commit 235374a

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

src/components/About.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="hello">
3-
<h1>{{ msg }}</h1>
3+
<p>About Page</p>
44
<i data-feather="home"></i>
55
</div>
66
</template>

src/components/Home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="hello">
3-
<h1>{{ msg }}</h1>
3+
<p>Home Page</p>
44
<i data-feather="home"></i>
55
</div>
66
</template>

src/main.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
import { createApp } from 'vue'
2-
import { createWebHistory, createRouter } from 'vue-router'
32
import App from './App.vue'
4-
import './assets/css/tailwind.css'
5-
import Home from './components/Home'
6-
import About from './components/About'
73
import router from './router'
4+
import './assets/css/tailwind.css'
85

96
const feather = require('feather-icons')
107
feather.replace()
118

12-
const routes = [
13-
{ path: '/', component: Home },
14-
{ path: '/about', component: About },
15-
];
16-
17-
const router = createRouter({
18-
history: createWebHistory(),
19-
routes
20-
});
21-
229
createApp(App).use(router).use(router).mount('#app')

src/router/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createRouter, createWebHistory } from 'vue-router'
2-
import Home from '../views/Home.vue'
2+
import Home from '../components/Home.vue'
33

44
const routes = [
55
{
@@ -13,7 +13,7 @@ const routes = [
1313
// route level code-splitting
1414
// this generates a separate chunk (about.[hash].js) for this route
1515
// which is lazy-loaded when the route is visited.
16-
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
16+
component: () => import(/* webpackChunkName: "about" */ '../components/About.vue')
1717
}
1818
]
1919

0 commit comments

Comments
 (0)