I first use this
export const paperRoute = {
path: '/paper/:id',
name: 'paper',
component: () => import('@/view/paper/paper-info'),
meta: {
title: 'papaer',
hideInMenu: true
}
}
in src/router/paper-routers.js and use it in src/router/routers.js by
import paperRoute from './paper-routers'
And when I get into 'localhost:8080/paper/1', nothing was there, even other pages that were loaded correctly turn into nothing.
After I change the paper-routers.js into
export default {
path: '/paper/:id',
name: 'paper',
component: () => import('@/view/paper/paper-info'),
meta: {
title: 'paper',
hideInMenu: true
}
}
The page was correctly loaded. I am confused, what's the difference between these two styles,
export const paperRouteexport default
when I use import paperRoute from 'src/router/paper-routers.js'.
Oh, my fault.
when using export, it should be
I forgot the brace.