如何使用 Meteor 创建多页应用程序? [英] How do I create multi-page applications with Meteor?

查看:51
本文介绍了如何使用 Meteor 创建多页应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Javascript 的新手,出于好奇,我刚刚开始摆弄 Meteor.真正让我感到惊讶的是,似乎所有 HTML 内容都合并到了一个页面中.

I am new to Javascript and just started fiddling around with Meteor out of curiosity. What really surprises me, is that it seems that all HTML content gets combined into a single page.

我怀疑有一种方法可以对指向特殊页面的 URL 进行一些处理.似乎todo"示例能够通过某种 Router 类来做到这一点.这是 URL 处理的规范"方式吗?

I suspect there is a way to introduce some handling of URLs directing to special pages. It seems that the "todo" example is capable of doing this via some kind of Router class. Is that the "canonical" way of URL handling?

假设我可以处理 URL,我将如何构建我的 HTML 代码以显示单独的页面?就我而言,它们每个都可以拥有完全独立的数据集,因此根本不需要共享 HTML 代码.

Assuming I can handle URLs, how would I structure my HTML code to display separate pages? In my case they could each have completely separate sets of data, so no HTML code needs to be shared at all.

推荐答案

Jon Gold 的回答曾经是正确的,但是 截至流星 0.5.4:

Jon Gold's answer used to be correct, but as of Meteor 0.5.4:

工作现已转移到 Iron Router.请考虑在新项目中使用 IR 而不是路由器!

Work has now shifted to Iron Router. Please consider using IR instead of Router on new projects!

因此,目前执行此操作的规范"方法可能是使用 IronRouter.

Thus, the current "canonical" way to do this is probably to use IronRouter.

这篇关于如何使用 Meteor 创建多页应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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