antvis / G6VP

G6VP is an online visual analysis tool for graphs and a low-code platform for building graph applications.
https://insight.antv.antgroup.com
Apache License 2.0
797 stars 109 forks source link

G6VP中导出的ESM源码,本地运行之后前端组件全部铺开展示(The ESM source code exported from G6VP, after running locally, displays all frontend components expanded) #579

Open keepon-01 opened 7 months ago

keepon-01 commented 7 months ago

您好,我在G6VP网站导出的ESM源码,我添加了index.html文件,本地运行之后发现,前端所有的组件全部摊开展示,而且很多交互是无效的。index.html文件的内容为: Hello, I exported the ESM source code from the G6VP website, and after adding an index.html file and running it locally, I found that all frontend components are displayed expanded, and many interactions are not working. The content of the index.html file is: image 前端展示的样式为: The frontend display style is: image 请问这个问题如何解决呢?非常感谢! How can this issue be resolved? Thank you very much!

keepon-01 commented 7 months ago

问题已经解决,在本地跑ESM的代码,需要将对应包中的/dist/index.css link到index.html中进行渲染,比如@antv/gi-assets-advance包等,才能够正常显示。 目前网站上导出ESM源码中没有index.html,所以我认为ESM中应该生成正确的index.html文件和内容,从而让用户导出到本地进行正确的运行

404area commented 6 months ago

ESM导出的源码是让集成到react中使用的吧,还有官网的demo,我发现还是有问题的会报如下错误,你遇到了吗? image