Javascript 如何使用Meteor创建类似于向导的体验?

Javascript 如何使用Meteor创建类似于向导的体验?,javascript,meteor,meteor-blaze,meteor-helper,Javascript,Meteor,Meteor Blaze,Meteor Helper,我想为用户将一个大网页分成小块,这样他们就不会被页面的大小/他们必须输入的信息量(无论如何,一次输入的信息量)压垮 我使用的是Meteor,我想知道如何在这个平台上实现这一点 我想到的第一个想法是为我想向用户展示的每个“子页面”创建一个单独的模板,然后一个接一个地展示模板。我在想可能是这样的: <body> <h2>Thirteen Ways of Looking at a Duckbilled Platypus</h2> <br/> <b

我想为用户将一个大网页分成小块,这样他们就不会被页面的大小/他们必须输入的信息量(无论如何,一次输入的信息量)压垮

我使用的是Meteor,我想知道如何在这个平台上实现这一点

我想到的第一个想法是为我想向用户展示的每个“子页面”创建一个单独的模板,然后一个接一个地展示模板。我在想可能是这样的:

<body>
<h2>Thirteen Ways of Looking at a Duckbilled Platypus</h2>

<br/>
<br/>

<div class="container">
   {{> whizzardBlizzard}}
</div>

</body>

<template name="whizzardBlizzard">
    <form>
    {{#if firstStep}}
    {{> firstStepTemplate}}
    {{/if}}
    {{#if secondStep}}
    {{> secondStepTemplate}}
    {{/if}}
    {{#if thirdStep}}
    {{> thirdStepTemplate}}
    {{/if}}
    <input type="submit" value="Submit" class="button">
    </form>
</template>

<template name="firstStepTemplate">
  <h2>Step 1</h2>
</template>

<template name="secondStepTemplate">
  <h2>Step 2</h2>
</template>

<template name="thirdStepTemplate">
  <h2>Step 3</h2>
</template>
…但我不确定这是否真的能满足要求或是最好的方法。有没有一种“受祝福的”方法可以用Meteor实现这一点,或者有一种公认的模式?

你可能会感兴趣,它已经适应了。你可能会感兴趣,它已经适应了。
Template.whizzardBlizzard.events({
    "submit form": function (event) {
        //event.preventDefault(); <= should this be uncommented?
        // save the vals to a new document in a collection
        Session.set('stepNum', Session.get('stepNum') + 1);
    }
});
Template.whizzardBlizard.helpers({
    firstStep: function() {
        return (Session.get('stepNum') == 1);
    },
    secondStep: function() {
        return (Session.get('stepNum') == 2)
    },
    thirdStep: function() {
        return (Session.get('stepNum') == 3)
    }
    . . . // etc.
});