{{Template.Tynamic template = content}}行は、私のページを読み込まないようにします。実際にはブラウザがクラッシュすることがあります。私はそれがしばらくの間働いていたが、何かが起こって、今はもう働かない。 {{> Template.dynamic template = 'navBar'}}は動作しますので、私のパッケージはokです。Meteor Dynamic Template not working
流星:1.4 パッケージ:kadira:フロールータ、kadira:ブレーズレイアウト
輸入/ UI /レイアウト/ mainLayout.html:
<template name="mainLayout">
<header>
<div class="container">
{{> navBar }}
</div>
</header>
<body>
<div class="container">
{{> Template.dynamic template=content }} <!-- not working -->
</div>
</body>
<footer>
<div class="container">
<h3>Footer</h3>
</div>
</footer>
</template>
輸入/ UI /レイアウト/ mainLayout。 JS:
import { Template } from 'meteor/templating';
import './mainLayout.html';
import '../components/navBar.html';
import '../pages/settings.html';
輸入/起動/クライアント/ routes.js:
import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import '../../ui/layouts/mainLayout.js';
import '../../ui/pages/settings.js';
FlowRouter.route('/', {
action() {
BlazeLayout.render('mainLayout', { content: 'mainLayout' });
},
});
FlowRouter.route('/settings', {
action() {
BlazeLayout.render('mainLayout', { content: 'settings' });
},
});
回の
輸入/ UI /ページ/ settings.html:
<template name="settings">
<div class="container">
<h1>This is the settings page</h1>
</div>
</template>
レイアウト内にレイアウトを配置していますか? 'BlazeLayout.render( 'mainLayout'、{content: 'mainLayout'});' – chazsolo