对于我的文件夹结构,我有(使用 Apps 文件夹)视图和 viewmodels 文件夹。当我尝试单击其中一个链接时,我不断收到“找不到路线”。页面加载时,Chrome 还会显示“找不到路由”。childRouter 的新手。为什么我得到“找不到路线”的任何想法?
LVA可用性视图模型-
define(['plugins/router', 'durandal/system', 'knockout'], function (router, system, ko) {
var childRouter = router.createChildRouter()
.makeRelative({
moduleId: 'viewmodels',
route: '',
fromParent: true
}).map([
{ route: 'AccessDenied', moduleId: 'AccessDenied', title: 'AccessDenied', type: 'intro', hash: '#AccessDenied', nav: true },
{ route: 'LCPost', moduleId: 'LCPost', title: 'LCPost', type: 'intro', hash: '#LCPost', nav: true }
]).buildNavigationModel();
var vm = {
router: childRouter,
title: 'Letter Of Credit',
introSamples: ko.computed(function () {
return ko.utils.arrayFilter(childRouter.navigationModel(), function (route) {
return route.type == 'intro';
});
}),
detailedSamples: ko.computed(function () {
return ko.utils.arrayFilter(childRouter.navigationModel(), function (route) {
return route.type == 'detailed';
});
})
};