我遇到了这个奇怪的错误:
“找不到名为‘loading’或‘loading’的模板。你确定你定义了它吗?”
就像Iron router: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
不幸的是,那里的答案不是很有帮助(可能是因为它很旧而且我已经在使用 1.0.7 版了)。
这是铁配置javascript:
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
waitOn: function() { return Meteor.subscribe('posts'); }
});
Router.route('/', {name: 'postsList'});
有什么提示吗? ^_^
最佳答案
多么棒的 StackOverflow 开始。我正在阅读“Discover Meteor”一书,不知何故我跳过了下一个添加实际微调器的部分。
添加以下代码解决了我的问题:
<template name="loading">
{{>spinner}}
</template>
我想我需要管理我的快速阅读技能,对此感到抱歉。
关于javascript - 铁 :router - "Couldn' t find a template named 'loading' . ..”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29345805/