create-react-app中的CytoscapeJS不触发console.log

我将Cytoscape.jscreate-react-app一起使用。终端正在运行应用程序,但未输出console.log。尤其是在handleclick方法中。

import React,{ Component } from 'react'
import Cs from 'cytoscape'
const { cyConfig,cyStyle } = require('./config/config')

class Graph extends Component {
  componentDidmount () {
    cyConfig.container = document.getElementById('cy')
    this.cy = Cs(cyConfig)
  }

  handleclick () {
    this.cy.on('tap','node',(e) => {
      const node = e.target
      console.log(node.id())
    })
  }

  render() {
    return (
      <div
        style={cyStyle}
        id='cy'
        onClick={ (e) => this.handleclick(e) }
      />
    )
  }

}

export default Graph
temp_0001 回答:create-react-app中的CytoscapeJS不触发console.log

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3094861.html

大家都在问