小编Mou*_*ina的帖子

节点步骤的边缘未在反应流渲染器中渲染

我试图将 data.js 文件中的步骤显示为节点,并尝试连接这些边。但边缘仅可见。在页面中。我使用了 [react-flow-renderer] 包1

当我刷新页面时,边缘甚至一秒钟都看不见。

我的反应组件

import React, { Component } from 'react'
import data from '../data'
import ReactFlow, {addEdge} from 'react-flow-renderer'


export class Pro2 extends Component {
    constructor() {
        super()
        this.state = {
            steps:data.map((step, index) => ({ id: step.id, data: {label: step["step-name"] }, position: {x: 500, y:100 * (index + 1)}})),
            tasks:[],
            sedges: data.slice(0, data.length - 1).map((step, index) => ({id:"e"+step.id+data[index+1].id, source: step.id, target: data[index+1].id, animated: true}))
        }
        console.log(this.state.steps, this.state.sedges)
        this.handleChange = this.handleChange.bind(this)
    }

    handleChange(t) {
        //console.log("clicked...............clicked …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-class-based-component react-flow

2
推荐指数
1
解决办法
7439
查看次数

+(readLine()) 给出 ReferenceError

const a = +(readLine())
console.log(a)
Run Code Online (Sandbox Code Playgroud)

给出一个错误

 const a = +(readLine())
           ^

ReferenceError: readLine is not defined
Run Code Online (Sandbox Code Playgroud)

如何修复它?readLine() 函数前面的 + 号的作用是什么

javascript node.js

1
推荐指数
1
解决办法
6819
查看次数