【问题标题】:How can I print something on the client console from a react component?如何从反应组件在客户端控制台上打印一些东西?
【发布时间】:2017-10-14 17:42:51
【问题描述】:

我不知道我是否给自己理解例如在文件 server/main.js 中放置类似这样的东西

Meteor.startup (() => {
     console.log ('where am I');
     // example of collection and map
   });

您可以看到消息,但在扩展的反应组件中我该怎么做,或者我必须导入一些方法?

【问题讨论】:

  • 你能做什么?在客户端控制台上打印一些东西?

标签: reactjs meteor console


【解决方案1】:

您也可以在客户端代码中使用console.log。如果您愿意,请将 console.log 粘贴在您的 render() 函数的顶部,您会在网络浏览器的控制台中看到一条消息。

【讨论】:

    猜你喜欢
    • 2022-10-07
    • 2018-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-09
    • 1970-01-01
    • 1970-01-01
    • 2018-03-26
    相关资源
    最近更新 更多