【问题标题】:How to use Bootstrap datepicker with Meteor如何在 Meteor 中使用 Bootstrap 日期选择器
【发布时间】:2013-12-18 21:07:56
【问题描述】:

我知道这个网站上已经回答了类似的问题,但 Meteor 在去年发生了很大变化,我还没有找到任何适合我的解决方案。我正在运行 Meteor 0.6.6.3。

我有一个简单的模板:

<template name="add_part">
  <form id="part_form">
    <input class="datepicker" id="date-id" name="date">
  </form>
</template> 

我的 client.js 中有以下内容:

Template.add_part.rendered = function() {
   $('.datepicker').datepicker();
}

我在控制台中收到以下错误:

Exception from Deps afterFlush function: Template.add_part.rendered@http://localhost:3000/client/client.js?091c09a531c04d4a8f09bbc8066245a490dec458:65
Template.__define__/partial/html</html<.rendered@http://localhost:3000/packages/templating.js?5944cd5e16b26fbf83959a0fe92d7754029a624d:181
scheduleOnscreenSetup/</<@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:443
_.forEach@http://localhost:3000/packages/underscore.js?13ab483e8a3c795d9991577e65e811cd0b827997:130
scheduleOnscreenSetup/<@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:441
.flush@http://localhost:3000/packages/deps.js?5ac28feec1f3e0539889ecde598dd9d01e408b41:265

【问题讨论】:

  • 我使用 jquery ui datepicker 的方式与您在同一 Meteor 版本上的使用方式完全相同,所以我不确定发生了什么。您使用的是软件包还是如何将 datepicker 库添加到 Meteor?

标签: javascript jquery twitter-bootstrap meteor


【解决方案1】:

landland 是对的。我忘了包含 jquery-ui.js 我以为它默认包含在 Bootstrap 中。至少这是一个非常清晰和简单的示例,说明如何使用 Meteor 执行此操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多