我正在尝试让 Jade 与 Meteor 的 Flow Router 和 Blaze 一起工作。不知何故,它对我不起作用。我很确定这只是我没有注意到的小事。
home.jade 和 layout.jade 文件的 HTML 版本给出了正确的工作结果。
根据 this ,曾经有一个问题,但在 mquandalle:jade 的 0.2.9 版本中解决了。
$ meteor 列表
blaze 2.1.2 Meteor Reactive Templating library
kadira:blaze-layout 2.0.0 Layout Manager for Blaze (works well with FlowRou...
kadira:flow-router 2.3.0 Carefully Designed Client Side Router for Meteor
meteor-platform 1.2.2 Include a standard set of Meteor packages in your...
mquandalle:jade 0.4.3 Jade template language
layout.jade
template(name="layout")
+Template.dynamic(template="main")
家 Jade
template(name="home")
p Looks like working!
路由.js
FlowRouter.route('/', {
name: 'home',
action: function() {
BlazeLayout.render('layout', {main: 'home'});
}
});
结果:
<body>
<div id="__blaze-root">
</div>
</body>
最佳答案
事实上,这只是一个微妙的细节问题:你不应该在 main
周围使用引号。布局模板中的参数:
template(name="layout")
+Template.dynamic(template=main)
关于meteor - 如何将 Meteor 与 Jade、Flow Router 和 Blaze 结合使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32199956/