Skip to content
Discussion options

You must be logged in to vote

找到原因了:是因为initdata的时候,传递的height:40。修改后就好

import { useGraphStore } from '@antv/xflow'
import React, { useEffect, useCallback } from 'react'

export default function InitData() {
  
  const initData = useGraphStore((state) => state.initData)
  const setInitData = useCallback(() => {
    initData({
      nodes: [
        {
          id: '1',
          shape: 'custom-react-node',
          x: 32,
          y: 32,
          width: 100,
          height: 40,    // 这里的原因
          label: 'Hello',
          attrs: {
            body: {
              stroke: '#8f8f8f',
              strokeWidth: 1,
              fill: '#fff',
              rx: 6,
              ry: 6,
            },
          },
   …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by liaodalin19903
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant