sample routes + first landing page and routing logic
This commit is contained in:
17
src/main.js
17
src/main.js
@@ -1,6 +1,21 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createWebHashHistory, createRouter } from 'vue-router';
|
||||
import App from './App.vue';
|
||||
import 'windi.css';
|
||||
import 'toastify-js/src/toastify.css';
|
||||
|
||||
createApp(App).mount('#app');
|
||||
// ---------------
|
||||
const Home = import('./components/Home.vue');
|
||||
const Register = import('./components/Register.vue');
|
||||
const Profile = import('./components/Profile.vue');
|
||||
//
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{ path: '/', component: Home },
|
||||
{ path: '/register', component: Register },
|
||||
{ path: '/profile', component: Profile }
|
||||
]
|
||||
});
|
||||
// ---------------
|
||||
createApp(App).use(router).mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user