多步骤工艺路线 [英] Routing for multi step process

查看:69
本文介绍了多步骤工艺路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

缩短并澄清了问题.

使用Iron Router在我的Meteor应用中实现以下目标的最实用方法是什么:

What's the most practical way to achieve the following in my Meteor app using Iron Router:

  • 条件A-显示模板A
  • 条件B-显示模板B
  • 否则-显示模板C

用于单个URL,因此用户不能直接输入"/url-a"或"/url-b"或"url-c"来显式选择视图/模板.

for a single URL, so that a user cannot directly enter "/url-a" or "/url-b" or "url-c" to select the view/template explicitly.

推荐答案

鉴于您提供的信息有限,我认为在您的路线中没有什么比以下逻辑短的了:

Given the limited information you've provided, I can't think of anything shorter than the following logic in your route:

if ( A ) this.render('templateA');
else if ( B ) this.render('templateB');
else this.render('templateC');

这假设您有一条带布局的路线,并且正在将模板渲染到该布局中.

This assumes that you have a route with a layout and you're rendering a template into that layout.

但是鉴于这个答案太微不足道了,我怀疑您是在问一个完全不同的问题.

But given this answer is so trivial I suspect you're asking a different question altogether.

这篇关于多步骤工艺路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆