Last active
November 6, 2022 10:45
-
-
Save Maxim-Kolmogorov/52085e19c773e38e61674ae4b86a685b to your computer and use it in GitHub Desktop.
Laravel 9 + Vite + Vue.js + SSR = example, part 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createWebHistory, createMemoryHistory, createRouter } from 'vue-router'; | |
const isServer = typeof window === 'undefined'; | |
const history = isServer ? createMemoryHistory() : createWebHistory(); | |
import Home from './pages/Home.vue'; | |
import About from './pages/About.vue'; | |
const routes = [ | |
{ path: '/', name: 'home', component: Home }, | |
{ path: '/about', name: 'about', component: About }, | |
]; | |
const router = createRouter({ | |
history, | |
routes, | |
}); | |
export default router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment