javascript - 如何在 react 表渲染后执行代码?

标签 javascript meteor coffeescript pug

我有一个名为 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"

我想在 react 表渲染后执行一段代码。我曾尝试将其放置在 inboxSectiononCreated 事件中,如下所示:

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

但这不起作用。如何在 react 表渲染后执行一些代码?

最佳答案

尝试

Template.inboxSection.onRendered ->

看看这是否有效。

关于javascript - 如何在 react 表渲染后执行代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40161621/

相关文章:

javascript - 数组索引在 $.get 中不起作用

meteor - cursor.observe 会降低服务器性能吗?

javascript - 如何查看一个类是否已经被实例化

javascript - 删除生产代码中的 console.assert

javascript - 为什么在 Safari 中使用 JavaScript 计划 Q1 year 22034 不可靠?

Meteor.js 0.6.5 和 Cloud 9

javascript - 将两个动态键分配给数组

javascript - 多个 ID 和唯一的名称

javascript - 在 NodeJS 中打开持久(mongo)数据库连接的最佳方法是什么

javascript - Meteor Select Box - 根据数据上下文将选项标记为选中