【问题标题】:iron-router notFound template not working in meteor铁路由器未找到模板在流星中不起作用
【发布时间】:2014-04-22 07:05:20
【问题描述】:
// 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: '/'
    });

});

http://hedcet.com:3000/”完美运行

但是

当我尝试未在 router.js 中定义的“http://hedcet.com:3000/x”(路由 /x)时,它在控制台中显示错误并且不显示 notFound 模板

// console error

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

您能提出任何解决方案吗?如果有任何尝试流星中不存在的路径,我想显示 notFound 模板

【问题讨论】:

    标签: javascript meteor meteorite iron-router


    【解决方案1】:

    你在 notFoundtemplate 中有一个 't' 应该是一个 'T'。

    【讨论】:

      猜你喜欢
      • 2016-05-04
      • 2014-09-07
      • 1970-01-01
      • 2014-04-30
      • 2023-03-09
      • 2016-01-22
      • 1970-01-01
      • 1970-01-01
      • 2014-10-30
      相关资源
      最近更新 更多