【问题标题】:How to execute code after reactive table has rendered?反应表渲染后如何执行代码?
【发布时间】:2017-03-02 21:04:35
【问题描述】:

我有一个名为inboxSection 的模板。在那个模板中,我有一个reactive table。代码如下所示:

template(name="inboxSection")
  .col-xs-12.curator-inbox-section-head
    .pull-left
      b {{formattedDate}}
    .pull-right
    +reactiveTable collection=posts settings=settings selector=selector class="curator-inbox-table" rowClass="curator-inbox-table-row"

我想在反应式表呈现后执行一段代码。我曾尝试将它放在onCreatedinboxSection 事件中,如下所示:

Template.inboxSection.onCreated ->
   # do something with the reactive table...

但这不起作用。如何在响应式表呈现后执行一些代码?

【问题讨论】:

    标签: javascript meteor coffeescript pug


    【解决方案1】:

    试试

    Template.inboxSection.onRendered ->
    

    看看能不能解决问题。

    【讨论】:

    • 是的!为什么我没有想到呢?谢谢!
    猜你喜欢
    • 2014-12-20
    • 2018-06-13
    • 1970-01-01
    • 1970-01-01
    • 2017-11-25
    • 2019-07-27
    • 1970-01-01
    • 2018-10-02
    相关资源
    最近更新 更多