我正在使用流星與鐵:路由器包。我想只呈現一個基本的模板到一個佈局模板,但繼續接收錯誤:流星無法渲染動態模板
Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
對於我的「/」的路線,我有以下幾點:
// router.js
Router.configure({
layout: 'layout'
});
Router.route('/', function() {
this.render('welcome');
});
我的模板看起來像:
<!--main.html -->
<head>
<title>App</title>
</head>
<body>
</body>
<template name='layout'>
<div id='container'>
{{> yield}}
</div>
</template>
<template name='welcome'>
<p>Welcome</p>
</template>
對於我的包,我最初嘗試只安裝iron:router插件。它似乎添加了鐵:核心,鐵:動態模板和鐵:佈局。因爲我已經單獨添加每個庫:
> meteor list
iron:core 0.3.4 Iron namespace and utilities.
iron:dynamic-template 0.4.1 Dynamically create and update templates and the...
iron:layout 0.4.1 Dynamic layouts which enable rendering dynamic ...
iron:router 0.9.4 Routing specifically designed for Meteor
meteor-platform 1.1.1 Include a standard set of Meteor packages in yo...
像saimeunt寫道,沒有必要使用
標籤 – yoK0 2014-10-03 02:15:15