Javascript 铁路由器未找到模板在meteor中不工作

Javascript 铁路由器未找到模板在meteor中不工作,javascript,meteor,meteorite,iron-router,Javascript,Meteor,Meteorite,Iron Router,你能提出解决办法吗?如果有人在meteor中尝试不存在的路径,我想显示notFound模板。您在notFoundtemplate中得到的“t”应该是“t”。您在notFoundtemplate中得到的“t”应该是“t” // main.html <template name="layout"> {{yield}} </template> <template name="notFound"> notFound </template>

你能提出解决办法吗?如果有人在meteor中尝试不存在的路径,我想显示notFound模板。

您在notFoundtemplate中得到的“t”应该是“t”。

您在notFoundtemplate中得到的“t”应该是“t”

// main.html

<template name="layout">
    {{yield}}
</template>

<template name="notFound">
    notFound
</template>

// router.js

Router.configure({
    layoutTemplate: "layout",
    loadingTemplate: "loading",
    notFoundtemplate: "notFound"
});

Router.map(function() {

    this.route('home', {
        path: '/'
    });

});
// console error

Uncaught Error: Oh no! No route found for path: "/x"