templates - meteor 整页模板

标签 templates meteor

我正在使用 Meteor。我试图拥有一个完整的页面模板(包括 bodyhead 标签)。因为其中一个是针对移动版本的。

我尝试过

{{> desktop}}

<template name="desktop">
    <head>...</head>
    <body>...</body>
</template>

<template name="mobile">
    <head>...</head>
    <body>...</body>
</template>

我遇到了语法错误(由于>桌面 handle )另外我如何在两个模板之间切换? (Meteor 添加了 <html> 标签和一堆 script 标签,所以有点问题

最佳答案

为桌面创建 desktop_headdesktop_body 模板,对移动设备执行相同的操作。

然后,在运行时,根据您的设备将模板添加到 body 和 head 标记中。不要引入额外的 head 和 body 标签,因为这不是它的工作原理,您需要有一个 body/head...

此外,您可能需要考虑响应式设计......

关于templates - meteor 整页模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11179531/

相关文章:

python - Django 中的模板不存在

mongodb - 使用 $or 进行 $text 搜索,结果为 "No query solutions"

Meteor up mup 部署失败

c++ - 按通用引用返回

C++ 模板依赖

c++ - 虚拟方法和模板方法 C++

javascript - meteor 从事件更新模板

javascript - 如何为 Meteor 应用程序中的第一个用户分配特定角色?

javascript - 在 jquery 的父级中间添加 html

cordova - 从图库上传图像或从移动相机 meteor Android 应用程序单击图像