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

线条插槽不能使用-- 并且使用了ovUseLineSlot属性 #309

Closed
ZhouJing0 opened this issue May 16, 2024 · 1 comment
Closed

线条插槽不能使用-- 并且使用了ovUseLineSlot属性 #309

ZhouJing0 opened this issue May 16, 2024 · 1 comment

Comments

@ZhouJing0
Copy link

relation-graph@2.1.42
vue@2.6.10
使用 线条插槽 组件里复制的dome
<template #line="{ line, link, lineIndex }">


线条不生效 报错 Cannot read properties of undefined (reading 'getArrow')
说明 relationGraph 为undefined

@ZhouJing0 ZhouJing0 changed the title 线条插槽不能使用 线条插槽不能使用-- 并且使用了ovUseLineSlot属性 May 16, 2024
@seeksdream
Copy link
Owner

relation-graph@2.1.x中在自定义节点、线条插槽中通过依赖注入获取graphInstance的方式发生了变化:
以前是:通过依赖的对象graph获取:graph.instance
现在是:通过依赖的方法graphInstance来获取:graphInstance()

你可以将你的代码以下内容按照下图修改一下就可以了:
image

相关的示例:
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