yield 不渲染模板
yield isnt rendering the template
我的项目中只有两个文件。
1) runner.html
<template name="layout">
inside
{{> yield }}
</template>
<template name="test">
Home
</template>
2) runner.js
Router.configure({
layoutTemplate:'layout'
});
Router.map(function(){
this.route("test",{
path:'/',
template: 'test'
})
});
现在当我打开浏览器时,我只得到
inside
即使我删除了模板,meteor 也不会抛出找不到的错误 template.I 最近已将 meteor 更新到 1.2.0.1。
控制台中也有一个错误,我无法弄清楚,因为有
代码中没有任何内容。
痕迹是
Exception in callback of async function: MiddlewareStack.prototype.concat@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:303:7
RouteController.prototype._runRoute@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:542:11
Route.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:856:10
Route/route@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:713:5
boundNext@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:425:16
Meteor.bindEnvironment/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:17
dispatch@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:449:3
RouteController.prototype.dispatch/</<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:393:7
Tracker.Computation.prototype._compute@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:5
Tracker.Computation@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:5
Tracker.autorun@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:596:11
RouteController.prototype.dispatch/<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:391:5
Tracker.nonreactive@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:623:12
RouteController.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:390:3
Router.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1700:3
onLocationChange@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1784:20
Tracker.Computation.prototype._compute@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:5
Tracker.Computation@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:5
Tracker.autorun@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:596:11
Router.prototype.start@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1777:31
Router/</<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:980:9
.withValue@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:979:17
withoutInvocation/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:436:26
Meteor.bindEnvironment/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:17
onGlobalMessage@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:373:11
meteor.js:888:11
注意:两个文件都在项目根目录中,我刚刚安装了 iron:router
没有别的。
很可能是我和其他许多人最近遇到的相同问题。这是由我猜测的一些版本问题引起的,因为流星正在经历快速变化。解决办法是:
meteor add ejson
如此处所示:
meteor add ejson 已为我修复。花了几个小时试图找出问题。
我的项目中只有两个文件。
1) runner.html
<template name="layout">
inside
{{> yield }}
</template>
<template name="test">
Home
</template>
2) runner.js
Router.configure({
layoutTemplate:'layout'
});
Router.map(function(){
this.route("test",{
path:'/',
template: 'test'
})
});
现在当我打开浏览器时,我只得到
inside
即使我删除了模板,meteor 也不会抛出找不到的错误 template.I 最近已将 meteor 更新到 1.2.0.1。 控制台中也有一个错误,我无法弄清楚,因为有 代码中没有任何内容。
痕迹是
Exception in callback of async function: MiddlewareStack.prototype.concat@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:303:7
RouteController.prototype._runRoute@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:542:11
Route.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:856:10
Route/route@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:713:5
boundNext@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:425:16
Meteor.bindEnvironment/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:17
dispatch@http://localhost:10001/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:449:3
RouteController.prototype.dispatch/</<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:393:7
Tracker.Computation.prototype._compute@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:5
Tracker.Computation@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:5
Tracker.autorun@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:596:11
RouteController.prototype.dispatch/<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:391:5
Tracker.nonreactive@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:623:12
RouteController.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:390:3
Router.prototype.dispatch@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1700:3
onLocationChange@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1784:20
Tracker.Computation.prototype._compute@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:5
Tracker.Computation@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:5
Tracker.autorun@http://localhost:10001/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:596:11
Router.prototype.start@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:1777:31
Router/</<@http://localhost:10001/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:980:9
.withValue@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:979:17
withoutInvocation/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:436:26
Meteor.bindEnvironment/<@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:17
onGlobalMessage@http://localhost:10001/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:373:11
meteor.js:888:11
注意:两个文件都在项目根目录中,我刚刚安装了 iron:router
没有别的。
很可能是我和其他许多人最近遇到的相同问题。这是由我猜测的一些版本问题引起的,因为流星正在经历快速变化。解决办法是:
meteor add ejson
如此处所示:
meteor add ejson 已为我修复。花了几个小时试图找出问题。