0
尝试使用the format here设置项目。我有一个名为view-scheduling.js的文件,在导入/ pages /文件夹中设置。它包含:如何使用Meteor中的Iron Router路由动态页面?
export const ViewScheduling =() => (
<div class="view-scheduling">
This schedule
</div>
)
路由器看起来像:
Router.route('/scheduling', {
name: 'viewScheduling',
onBeforeAction: function(){
import '../imports/ui/pages/view-scheduling.js';
this.next();
}
})
我三重检查的路径。我在加载时出现以下错误http://localhost:3000/scheduling
无法找到名为“ViewScheduling”或“viewScheduling”的模板。你确定你定义了它吗?
我该如何让'这个时间表'出现?
所以,这是否意味着我不能使用导入文件夹结构,或者在路径和导入文件夹中看起来如何? – notthehoff
您可以使用js的导入文件夹,但将所有的火焰HTML文件放在'/ client'下。 html文件无法导入,并且blaze正在查找实际的html文件。我还没有尝试从js中导出实际上有模板声明的html字符串,但我怀疑它会起作用。 –