流星铁路由器未加载模板((可能已弃用))

时间:2015-10-11 21:43:08

标签: javascript meteor iron-router meteor-blaze

这里没有其他问题回答我的问题,也许我的情况有点不同,因为我认为这可能是由于包问题或默认的Meteor应用程序中的某些变化。

HTML

<template name="mainLayout">
    <header>
        <div class="siteTitle">
            <h1> Title of App </h1>
            <blockquote>
                No application runs better!
            </blockquote>
        </div>
        <nav>
            <ul>
                <li> <a href="/"> Home </a> </li>
                <li> <a href="/name"> Test Routes </a> </li>
            </ul>
        </nav>
    </header>

    <section class="main">
        {{> yield}}
    </section>

    <footer>
        <p> Copyrights 2015 - David Davis - Meteor Test Dev </p>
    </footer>
</template>

<template name="home">
    <h2> Test </h2>
    <p> Test Message </p>
</template>

<template name="name">
    <form class="somePost">
        <label> What is your Name? </label>
        <input type="text" name="text" placeholder="Ex: John Smith III" />

        <label> Do you like Meteor? </label>
        <select>
            <option value="true">  Yes </option>
            <option value="false"> No </option>
        </select>

        <button type="submit" class="btn btn-primary"> Submit </button>
    </form>
</template>

路线

Router.configure({
    layoutTemplate: 'mainLayout'
});

Router.route('/', function () {
  this.render('home');
}, {
  name: 'home'
});

Router.route('/name', function () {
  this.render('name') },
  { name: 'name' }
);

套餐

meteor-base             # Packages every Meteor app needs to have
mobile-experience       # Packages for a great mobile UX
mongo                   # The database Meteor supports right now
blaze-html-templates    # Compile .html files into Meteor Blaze views
session                 # Client-side reactive dictionary for your app
jquery                  # Helpful client-side library
tracker                 # Meteor's client-side reactive programming library

standard-minifiers      # JS/CSS minifiers run for production mode
es5-shim                # ECMAScript 5 compatibility for older browsers.
ecmascript              # Enable ECMAScript2015+ syntax in app code

#autopublish             # Publish all data to the clients (for prototyping)
insecure                # Allow all DB writes from clients (for prototyping)

iron:router             # Iron Router for setting up multiple views / URIs
manuelschoebel:ms-seo   # SEO - Customize Titles

# Aldeed Database Information

aldeed:simple-schema
aldeed:autoform
aldeed:collection2

注意

这个相同的代码在我使用的meteor-platform软件包的旧版本的meteor上工作正常,现在已弃用。

工作包

这是在运行代码时有效的一组工作包。

meteor-platform
autopublish
insecure

iron:router
aldeed:simple-schema
aldeed:autoform
aldeed:collection2
manuelschoebel:ms-seo
fourseven:scss
accounts-ui
accounts-password
alanning:roles

0 个答案:

没有答案