Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Node-style-component can't be used in vue to define components, can only be used in jsx? #6720

Open
2 of 10 tasks
21236774 opened this issue Jan 11, 2025 · 0 comments
Open
2 of 10 tasks
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@21236774
Copy link

21236774 commented Jan 11, 2025

Describe the bug / 问题描述

vue中怎么使用自定义dom,目前项目不是在react项目
配置项:

{
node: {
      type: 'rect',
      style: (d) => {
        return {
          radius: 10,
          size: [106, 58],
          component: Node(d)
        }
      },
      state: {
        selected: {
          labelFontWeight: 'normal',
          lineWidth: 0,
          halo: false
        }
      }
   
}
}

Node函数

const Node = (data) => {
  const { name } = data
  const containerStyle = {
    width: '100%',
    height: '100%',
    border: `3px solid #fff`,
    borderRadius: 16,
    cursor: 'pointer'
  }
  return h('div', { style: containerStyle }, name)
}

Reproduction link / 复现链接

暂无

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@21236774 21236774 added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 11, 2025
@github-actions github-actions bot changed the title [Bug]: vue中使用 Node-style-component不能定义组件啊,只能在jsx中使用? [Bug]: Node-style-component can't be used in vue to define components, can only be used in jsx? Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant