naive-ui/demo/routes/debugRouteMixin.js
songwanli2025@163.com 519b3c92af modify(routes)
2020-03-20 18:53:14 +08:00

39 lines
1.7 KiB
JavaScript

import routerDebug from '../debugComponents/routerDebug'
import modalDebug from '../debugComponents/modalDebug'
import datePickerDebug from '../debugComponents/datePickerDebug'
import backTopDebug from '../debugComponents/backTopDebug'
import suffixDebug from '../debugComponents/suffixDebug'
import cascaderDebug from '../debugComponents/cascaderDebug'
import verticalAlignDebug from '../debugComponents/verticalAlignDebug'
import iconTransitionDebug from '../debugComponents/iconTransitionDebug'
import selectDebug from '../debugComponents/selectDebug'
import popoverDebug from '../debugComponents/popoverDebug'
import scrollbarDebug from '../debugComponents/scrollbarDebug'
import scrollbarDebug2 from '../debugComponents/scrollbarDebug2'
import { withPrefix } from './utils'
const rootDebugRoutes = [
{ path: '/n-popover-debug', component: popoverDebug },
{ path: '/n-back-top-debug', component: backTopDebug },
{ path: '/n-cascader-debug', component: cascaderDebug }
]
const childDebugRoutes = [
{ path: '/n-scrollbar-debug2', component: scrollbarDebug2 },
{ path: '/n-date-picker-debug', component: datePickerDebug },
{ path: '/n--debug', component: suffixDebug },
{ path: '/n-vertical-align-debug', component: verticalAlignDebug },
{ path: '/n-icon-transition-debug', component: iconTransitionDebug },
{ path: '/n-select-debug', component: selectDebug },
{ path: '/n-router-debug', component: routerDebug },
{ path: '/n-modal-debug', component: modalDebug },
{ path: '/n-scrollbar-debug', component: scrollbarDebug }
]
export default function debugRouteMixin (routes, childRoutes) {
childRoutes.unshift(...withPrefix('/:lang/:theme/doc', childDebugRoutes))
// routes[0].children[1].children = childRoutes
routes.unshift(...rootDebugRoutes)
}