vue-draggable-next ?.报错问题

 

error in ./node_modules/_vue-draggable-next@2.3.0@vue-draggable-next/dist/vue-draggable-next.esm-bundler.js

Module parse failed: Unexpected token (3162:28)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| function getChildrenNodes() {
> return instance?.proxy?.$el.children || [];
| }

 

原因是 js语法(可选链操作符 ?.)未被正确转译,Webpack 无法解析导致的

如果尝试修改babel.config 、webpack.config 均无效的话,可以将  package.json 里

"vue-draggable-next": "^2.2.0"   修改为 "vue-draggable-next": "2.2.0"  ,版本低于2.3.0即可
posted @ 2025-09-03 13:12  yutang-bai  阅读(52)  评论(0)    收藏  举报