Skip to content

Instantly share code, notes, and snippets.

@mattcdavis1
Created May 11, 2021 14:10
Show Gist options
  • Save mattcdavis1/45bad16b233b9c2281dc1bf32c64e9f4 to your computer and use it in GitHub Desktop.
Save mattcdavis1/45bad16b233b9c2281dc1bf32c64e9f4 to your computer and use it in GitHub Desktop.
import { createRouter, createWebHistory } from 'vue-router'
import Projects from '~/vue/app/projects/index'
import Dashboard from '~/vue/app/dashboard/index'
import ProjectDetail from '~/vue/app/projects/detail'
import ProjectCreate from '~/vue/app/projects/create'
const routes = [
{
path: '/',
redirect: '/projects',
},
{
path: '/dashboard',
name: 'dashboard',
components: {
default: Dashboard,
},
},
{
path: '/projects',
name: 'projects',
components: {
default: Projects,
},
},
{
path: '/projects/create',
name: 'projects.create',
components: {
default: ProjectCreate,
},
meta: { parent: 'projects' }
},
{
path: '/projects/:id',
name: 'projects.detail',
component: ProjectDetail,
meta: { parent: 'projects' }
}
]
export default createRouter({
history: createWebHistory('/app'),
routes,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment