Closed aloserman closed 1 year ago
Hi @aloserman, thank you for the comment.
You have to call position
method when you changed the layout of the page.
When the page layout changes, due to the recursive method adopted, the Lines of the parent are not passed to the current page (it should be said that I don't know how to pass it in, because I am not very familiar with Vue development), so I can't call the Line.position method of the parent or the parent's parent? Is there any other way?
The position
method is instance method, it is not class method. That is, each instance of LeaderLine has the method.
Therefore, you don't have to get the parent or the parent's parent.
The example in the document that I indicated may help you.
That's right. However, I adopted a recursive approach, which means that each level can only obtain the Line instance of the current level, and cannot obtain the parent class, so I cannot call the position method of the parent class Line instance. Maybe I need to obtain all Line instances through provide/inject in Vue, in order to call the position method.
Sorry, I couldn't understand the "level" and "parent class" that you said.
Anyway, the position
method is instance method, it is not class method. The class is not needed, and you can call an instance method via the instance without the class.
For example:
line.position();
No reply came, then this abandoned issue is closed.
Hi @anseki - Just want to ask if there was a specific reason the leader-line repo was archived? Was it a case that the codebase became outdated, or there is a specific reason not to use this library anymore?
Is there a recomended alternative?
Yes, it is outdated. Using another library for drawing lines or helper to handle SVG is better way. However, writing SVG code instead of using the library is best way.
When I dynamically layout divs, the div components at the previous level will change position or size due to the newly appeared div components. Therefore, the lines that have been drawn before will detach from the div components because they are not redrawn. The div components are generated recursively using Vue. Is there any good solution to this situation?