【问题标题】:What does `window.jqueryFoo = false;` mean?`window.jqueryFoo = false;` 是什么意思?
【发布时间】:2018-03-03 10:06:43
【问题描述】:

对于上下文,我在一个反应​​组件中看到它

export default class pageWithModal extends React.Component {
  constructor(props) {
    super(props);
    window.jqueryFoo = false;

    this.state = {
      modal: false,
      value: ''
    };
  }

  handleModalOpen = () => {...};

  handleModalClose = () => {...};

  render()...

它有什么作用?谷歌搜索没有找到类似的东西

【问题讨论】:

  • I saw it in a react component 是组件中对jqueryOn 的唯一引用吗?
  • 是的,只有一个在整个代码库中

标签: javascript jquery reactjs ecmascript-6


【解决方案1】:

这意味着在窗口的全局上下文中名为 jqueryOn 的变量被设置为 false。

【讨论】:

    猜你喜欢
    • 2014-11-05
    • 2021-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-29
    • 1970-01-01
    • 1970-01-01
    • 2016-05-26
    相关资源
    最近更新 更多