项目同时依赖antv/x6@1.x和antv/x6@2.x #4436
Unanswered
Chuchudongren
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
项目是vue2的项目,由于项目的历史开发问题,老功能依赖antv/x6@1.x版本,现新的模块需要用antv/x6@2.x版本的依赖进行开发。有没有办法可以同时在一个项目中依赖两个版本的antv/x6。
我尝试通过在package.json中通过别名安装:
"@antv/x6": "^1.34.6",
"@antv/x6-vue-shape": "^1.5.4",
"@antv/x62": "npm:@antv/x6@^2.18.1",
"@antv/x6-vue-shape2": "npm:@antv/x6-vue-shape@^2.1.2",
在文件中引用
对应版本之后,其中@2.x版本,import { register } from '@antv/x6-vue-shape2'
通过 register() 进行 注册 vue组件,在画布中引用失败。
我想应该还是依赖本身的问题。
希望能提供给我一些思路!万分感谢!!
Beta Was this translation helpful? Give feedback.
All reactions