本文整理汇总了TypeScript中aurelia-router.RouterConfiguration.mapUnknownRoutes方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RouterConfiguration.mapUnknownRoutes方法的具体用法?TypeScript RouterConfiguration.mapUnknownRoutes怎么用?TypeScript RouterConfiguration.mapUnknownRoutes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-router.RouterConfiguration
的用法示例。
在下文中一共展示了RouterConfiguration.mapUnknownRoutes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configureRouter
public configureRouter(config: RouterConfiguration, router: Router) : void {
config.title = "Aurelia";
config.map([
{
route: ["", "current-games"],
name: "current-games",
moduleId: "current-games",
nav: true,
title: "Current games",
},
{
route: "summoners",
name: "summoners",
moduleId: "summoner-overview",
nav: true,
title: "Summoners",
},
{
route: "logout",
name: "logout",
moduleId: "logout",
nav: false,
title: "Logout",
},
]);
config.mapUnknownRoutes(instruction => "summoner-overview");
this.router = router;
}
示例2: configure
configure(config: RouterConfiguration) {
config.options.pushState = true;
config.map([
{
route: ["", "home"],
title: "Home",
name: consts.routeStates.home,
moduleId: `${consts.basePath}/areas/home/home`,
nav: false,
settings: {}
}, {
route: "heroes",
title: "Heroes",
name: consts.routeStates.heroesLayout,
moduleId: `${consts.basePath}/areas/hero/hero-layout`,
nav: true,
settings: {}
}, {
route: "basic-form",
title: "Basic Form",
name: consts.routeStates.basicForm,
moduleId: `${consts.basePath}/areas/basic-form/basic-form`,
nav: true,
settings: {}
}, {
route: "route-builder",
title: "Route builder lab",
name: consts.routeStates.routeBuilder,
moduleId: `${consts.basePath}/areas/route-builder/route-builder.component`,
nav: true,
settings: {}
}
]);
config.mapUnknownRoutes(`${consts.basePath}/areas/error/not-found`);
}
示例3: configureRouter
configureRouter(config: RouterConfiguration): void {
logger.debug("configuring the router");
config.title = "SKG - Adventure";
config.map([
{ route: '', redirect: 'level-select' },
{ route: 'level-select', name: 'level-select', moduleId: 'level-select/level-select' }
]);
config.mapUnknownRoutes('level-select/level-select');
}
示例4: configureRouter
configureRouter(config: RouterConfiguration): void {
logger.debug("configuring the router");
config.title = "SKG";
config.map([
{ route: ['', 'home'], name: 'home', moduleId: 'home/home' },
{ route: 'online', name: 'online', moduleId: 'online/online' },
{ route: 'local', name: 'local', moduleId: 'local/local' },
{ route: 'adventure', name: 'adventure', moduleId: 'adventure/adventure' },
{ route: 'skynet', name: 'skynet', moduleId: 'aigame/aigame' }
]);
config.mapUnknownRoutes('home/home');
}
示例5: configureRouter
configureRouter(config: RouterConfiguration, router: Router) {
config.title = 'Aurelia';
config.options.pushState = true;
config.options.root = '/';
config.map([
{ route: ['', 'welcome'], name: 'welcome', moduleId: PLATFORM.moduleName('./welcome'), nav: true, title: 'Welcome' },
{ route: 'users', name: 'users', moduleId: PLATFORM.moduleName('./users'), nav: true, title: 'Github Users' },
{ route: 'child-router', name: 'child-router', moduleId: PLATFORM.moduleName('./child-router'), nav: true, title: 'Child Router' }
]);
config.mapUnknownRoutes(PLATFORM.moduleName('not-found'));
this.router = router;
}
示例6: configureRouter
public configureRouter(config: RouterConfiguration, router: Router) {
config.title = "Aurelia";
config.map([
{
route: ["", "welcome"],
name: "welcome",
moduleId: "welcome",
nav: true,
title: "Welcome",
},
{
route: "login",
name: "login",
moduleId: "login",
nav: false,
title: "Login",
},
]);
config.mapUnknownRoutes(instruction => "welcome");
this.router = router;
}
示例7: configureRouter
configureRouter(config: RouterConfiguration, router: Router) {
this.router = router;
config.title = UIConstants.App.Title;
config.mapUnknownRoutes('./home/404');
config.map([
{
route: ['', 'home'],
moduleId: './home/view',
title: 'Home',
nav: false,
auth: false,
name: 'home'
}, {
route: 'start',
moduleId: './home/start',
title: 'Getting Started',
nav: true,
auth: false,
settings: { section: 'Framework', disabled: true },
name: 'start'
}, {
route: 'example',
moduleId: './home/example',
title: 'App Example',
nav: true,
auth: false,
settings: { section: 'Framework', disabled: true },
name: 'example'
}, {
route: 'styles',
moduleId: './styles/view',
title: 'Styling',
nav: true,
auth: false,
settings: { section: 'Framework' },
name: 'styles'
}, {
route: 'viewport',
moduleId: './core/viewport',
title: 'Viewport',
nav: true,
auth: false,
settings: { section: 'Core Elements', disabled: true },
name: 'viewport'
}, {
route: 'pages',
moduleId: './core/pages',
title: 'Pages',
nav: true,
auth: false,
settings: { section: 'Core Elements' },
name: 'pages'
}, {
route: 'grid',
moduleId: './core/grid',
title: 'Responsive Grid',
nav: true,
auth: false,
settings: { section: 'Core Elements' },
name: 'grid'
}, {
route: 'input',
moduleId: './inputs/view',
title: 'Inputs',
nav: true,
auth: false,
settings: { section: 'Input Elements' },
name: 'input'
}, {
route: 'option',
moduleId: './inputs/option',
title: 'Option Inputs',
nav: true,
auth: false,
settings: { section: 'Input Elements' },
name: 'option'
}, {
route: 'list',
moduleId: './inputs/list',
title: 'Lists',
nav: true,
auth: false,
settings: { section: 'Input Elements' },
name: 'list'
}, {
route: 'markdown',
moduleId: './inputs/markdown',
title: 'Markdown Editor',
nav: true,
auth: false,
settings: { section: 'Input Elements' },
name: 'markdown'
}, {
route: 'button',
moduleId: './inputs/button',
title: 'Buttons',
nav: true,
auth: false,
settings: { section: 'Input Elements' },
name: 'button'
//.........这里部分代码省略.........