使用许多 HTML 模板文件构建大型 Meteor 应用程序的最佳实践是什么? [英] What are the best practices for structuring a large Meteor app with many HTML template files?

查看:18
本文介绍了使用许多 HTML 模板文件构建大型 Meteor 应用程序的最佳实践是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在所有示例(排行榜、文字游戏等)中,它们都有一个 HTML 模板文件.是否有一些包含许多不同 HTML 模板文件的大型开源 Meteor 项目可以用作最佳实践示例?将大型应用程序需要的所有内容都放在一个模板文件中似乎不切实际.

In all the examples (leaderboard, wordplay, etc.) they have one single HTML template file. Is there some large open source Meteor project with many different HTML template files we can use as a best practice example? Doesn't seem practical to put everything a large app needs all in one template file.

推荐答案

把这一切放在一起!来自文档:

Lump it all together! From the docs:

> HTML files in a Meteor application are treated quite a bit differently
> from a server-side framework. Meteor scans all the HTML files in your
> directory for three top-level elements: <head>, <body>, and
> <template>. The head and body sections are seperately concatenated
> into a single head and body, which are transmitted to the client on
> initial page load.
> 
> Template sections, on the other hand, are converted into JavaScript
> functions, available under the Template namespace. It's a really
> convenient way to ship HTML templates to the client. See the templates
> section for more.

这篇关于使用许多 HTML 模板文件构建大型 Meteor 应用程序的最佳实践是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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