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

line插槽获取relationGraph为空 #328

Closed
Halecoder opened this issue Jun 21, 2024 · 1 comment
Closed

line插槽获取relationGraph为空 #328

Halecoder opened this issue Jun 21, 2024 · 1 comment

Comments

@Halecoder
Copy link

image

用的官网实例
https://www.relation-graph.com/#/demo/vue3?id=adv-line-slot

@seeksdream
Copy link
Owner

这个示例很老了(只不过因为这里根本没用到老的传参方式的relationGraph,所以也没更新代码)。
新的方式都是通过依赖注入的方式来获取graphInstance的:

...
inject: ['graph', 'graphInstance'],
...
computed: {
    ...
    relationGraph() {
      return this.graphInstance();
    }
}

参考这个示例:
https://www.relation-graph.com/#/demo/vue2?id=adv-line-slot2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants