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

使用vue组件渲染节点内容时,如何让节点的宽高等于vue组件本身的宽高 #2964

Closed
565823371556Zsl opened this issue Nov 29, 2022 · 9 comments

Comments

@565823371556Zsl
Copy link

Describe the feature you'd like to request

渲染vue节点的时候,如果注册自定义节点时,不指定宽高,渲染出来后,容纳vue节点内容的foreignObject的宽高就都是1px,这就造成了连接桩的位置全都集中在一点

Describe the solution you'd like

希望渲染vue节点后,foreignObject的宽高自动被vue节点充满,不需要在注册的时候显示指定宽高

Describe alternatives you've considered

Your Example Website or App

No response

Screenshots or Videos

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Nov 29, 2022

👋 @565823371556Zsl

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@NewByVector
Copy link
Contributor

这个在框架内部是不容易做到的,但是外部可以实现,在节点内部的 vue 组件渲染完成后,获取尺寸,然后 resize 节点。不过还是建议在项目中固定节点宽和高。

@565823371556Zsl
Copy link
Author

这个在框架内部是不容易做到的,但是外部可以实现,在节点内部的 vue 组件渲染完成后,获取尺寸,然后 resize 节点。不过还是建议在项目中固定节点宽和高。

谢谢,按你说的问题已解决

@History-1024
Copy link

您好 我试着写了一下 resize您是怎么用的 方面截个代码图片吗

@zjydipingxian
Copy link

同问, 方便截个代码片段图片吗

@History-1024
Copy link

History-1024 commented Feb 27, 2024 via email

@zjydipingxian
Copy link

这个在框架内部是不容易做到的,但是外部可以实现,在节点内部的 vue 组件渲染完成后,获取尺寸,然后 resize 节点。不过还是建议在项目中固定节点宽和高。

谢谢,按你说的问题已解决

方便截个代码片段图片吗

@zjydipingxian
Copy link

到现在我也没解决 哈哈  不弃不离 @.***  

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年2月27日(星期二) 上午10:22 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [antvis/X6] 使用vue组件渲染节点内容时,如何让节点的宽高等于vue组件本身的宽高 (Issue #2964) 同问, 方便截个代码片段图片吗 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

把高度写死就支持我想做的业务了. 现在就是不想写死

@History-1024
Copy link

History-1024 commented Feb 27, 2024 via email

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

4 participants