-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
vue2框架,使用@antv/x6-vue-shape加载组件,弄好以后,npm发包,各种异常 #3961
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. |
能否用 codesanbox 搞个复现环境? |
这是https://codesandbox.io/p/sandbox/solitary-snowflake-g8x6kv,执行yarn run lib 编译,然后报的一个vue-demi 的异常,我本地没有这个报错,解决了这个问题以后,等程序打包完成以后,把打完完成的代码引入main里边,出现异常 |
看下有没有熟悉 vue 的朋友解答一下呀。 |
感觉还是 |
已解决,还是vue-demi的问题
|
能否分享一下解决思路呢🥳。 |
根据vue-demi官网,然后需要在webpack 中添加以下规则,否则编译的时候会出现一些方法不匹配的问题 |
我没有找到这个vue-demi的解决办法,就拿另一个包试了试,不管是直接预览还是打包lib都没有问题。
改成以下代码
|
https://codesandbox.io/p/sandbox/kind-hooks-r8ng4z 这是我处理好的demo,如果把vue.config.js里边的配置去掉,就会有问题了 |
谢谢!已经处理好了,你这个使用html的形式注入可行,用vue的component的直接注入确实有点问题,主要还是vue-demi得配置问题,会报错找不到一系列内置方法 |
使用html注入有优点也有缺点:
|
1.antv x6使用的是2.的版本,前端项目是vue2的版本,使用的webpack打包 |
Describe the bug
不npm发包是正常的,发包以后就各种异常,首先是显示vue-demi不存在,然后下载包以后,createAPP不存在,把源码内容,涉及到的vue3判断注释掉以后,不再报错,但是拖拽不显示组件内容,拖拽进来的组件只会显示定义好的连接桩
Your Example Website or App
无
Steps to Reproduce the Bug or Issue
1、开发好组件
2、进行 "lib": "vue-cli-service build --target lib ./packages/index.js" 打包
3、引用
4,报错
Expected behavior
修复好
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: