我有以下頁面:鐵路由器在靜態情況下
main.html中
<html>
<body>
<div>
[more static content]
<div id="content"></div>
</div>
</body>
</html>
tpl1.html
<template name="something">
[...]
</template>
而且我想用鐵路由器將「something」模板填充到「content」div中。我無法找到一種路徑路徑來呈現只有一個div。我試着這樣做:
<div id="content">{{yield}}</div>
但始終結果是:
<html>
<body>
<div>
[more static content]
<div id="content"></div>
</div>
[... content from "something" template ...]
</body>
</html>
而不是:
<html>
<body>
<div>
[more static content]
<div id="content">[... content from "something" template ...]</div>
</div>
</body>
</html>
什麼是我想要做的。
我的鐵路由器配置爲:
Router.map(function() {
this.route('principal',{
path:"/someaction",
template:"something"
});
¿我如何能做到這一點?謝謝!
你有沒有試過* *