【问题标题】:What do I need to do to load a bootstrap example using Meteor我需要做什么才能使用 Meteor 加载引导示例
【发布时间】:2014-08-06 00:14:43
【问题描述】:

今晚我安装了我的第一个流星包。我想要做的只是进一步将排行榜示例合并到较少版本的引导程序中。

具体来说,我想使用这个引导示例布局(我基本上只是复制了 html):

bootstrap jumbotron example

我一直在关注这个教程:

Meteor.js and Twitter Bootstrap - The right way

当我尝试启动应用程序时,我得到:

> $ meteor
[[[[[ ~/bootstrapApp ]]]]]

=> Started proxy.
=> Started MongoDB.     
=> Errors prevented startup:

While building the application:
bootstrapApp.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)

=> Your application has errors. Waiting for file change.
=> Modified -- restarting.
=> Errors prevented startup:

While building the application:
bootstrapApp.html:1: bad formatting in HTML template

=> Your application has errors. Waiting for file change.

我删除了文档类型,然后我收到了错误的格式错误。

我不知道 Meteor 在渲染引导 html 页面时会做什么。显然 CSS 和 JS 会在不同的目录中,所以不会被加载。

谁能告诉我如何正确加载此页面?这个我期待的很简单,新手的诅咒!

我不确定流星模板代码应该放在哪里,我只是将它们放在关闭的 html 元素之后。

提前感谢您为我提供的任何帮助。

【问题讨论】:

    标签: javascript meteor twitter-bootstrap-3


    【解决方案1】:

    您只需要在 jumbotron 示例中包含 body 标记的内容。 Meteor 会为您完成剩下的工作。

    这里去掉了 head 和 script 标签。把它放在你的模板中,它应该可以工作。

    https://gist.github.com/nmacmunn/e45ec29654efa7893b59

    【讨论】:

    • 我克隆了该文件并将其移至 /bootstrapApp/bootstrapApp.html 我仍然收到该错误:您的应用程序正在崩溃。这是最新的日志。 => 错误阻止启动:构建应用程序时:bootstrapApp.html:1:HTML 模板格式错误 => 您的应用程序有错误。等待文件更改。我不确定问题是什么。如果有帮助,这是我的应用程序的内容: $ ls bootstrapApp.css bootstrapApp.html bootstrapApp.js 客户端 e45ec29654efa7893b59 packages smart.json smart.lock
    • 现在可以工作了 :) 只需将您的示例包装在正文标签中并对其进行排序。谢谢你的帮助:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-31
    • 2012-07-13
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多