Die Zeile {{> Template.dynamic template = content}} lässt meine Seite nicht laden. Tatsächlich stürzt mein Browser manchmal ab. Ich habe es für eine Weile gearbeitet, aber etwas ist passiert und jetzt funktioniert es nicht mehr. {{> Template.dynamic template = 'navBar'}} funktioniert so, dass meine Pakete in Ordnung sein sollten.Meteor Dynamic Template funktioniert nicht
Meteor: 1.4 Packages: kadira: flow-Router, kadira: blaze-Layout
Einfuhr/ui/Layout/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>
Einfuhr/ui/Layout/mainLayout. js:
import { Template } from 'meteor/templating';
import './mainLayout.html';
import '../components/navBar.html';
import '../pages/settings.html';
Importe/startup/client/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' });
},
});
Importe/ui/pages/settings.html:
<template name="settings">
<div class="container">
<h1>This is the settings page</h1>
</div>
</template>
rendern Rendern Sie also ein Layout in einem Layout? 'BlazeLayout.render ('mainLayout', {content: 'mainLayout'});' – chazsolo