【问题标题】:Why iron-router does not render carousel?为什么 Iron-router 不渲染轮播?
【发布时间】:2014-08-11 06:38:05
【问题描述】:

当我把它做成这样的时候,它可以完美地工作

<body>
{{> carousel}}
</body>
<Template name="carousel">
....here the code of carousel...
</Template>

但是当我使用 Iron-router 渲染模板时;它不会渲染轮播

<body>
{{rendreRouter}}
</body>
<Template name="carousel">
    ....here the code of carousel...
 </Template>

Router.map(function () {
  this.route('carousel',{
    path: '/'
  });
});

【问题讨论】:

  • 你的例子使用{{rendreRouter}},我认为应该使用{{renderRouter}}
  • 但是当我使用它时;没有渲染轮播的图像,我不知道为什么或如何修复它,因为我是 Meteor 的新手
  • 创建基本的流星应用程序来重现此问题并将其推送到某个 github 存储库,发给我链接,我会看看
  • 我在github上创建的,链接是link

标签: meteor iron-router owl-carousel


【解决方案1】:

在 template.rendered 钩子中初始化你的轮播,例如我的模板名为 main_slider。

Template.main_slider.rendered = function() {
    // init carousel here
};

【讨论】:

    【解决方案2】:

    我得出的结论是documentation you're reading is not in sync with the code base.其实it looks like the feature is gone

    在我自己对该主题的探索中,I have an alternate solution at that may work for you 在这篇文章的底部。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-23
      • 2015-12-22
      • 2022-06-15
      • 2023-03-30
      • 2015-03-06
      • 2014-01-16
      • 1970-01-01
      相关资源
      最近更新 更多