Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

使用了sortablejs,提示找不到依赖jquery'

使用了import Sortable from 'sortablejs'后提示,如果去使用Sortable是不会报错的,求解

This dependency was not found:

  • jquery' in ./node_modules/sortablejs/modular/sortable.complete.esm.js

To install it, you can run: npm install --save jquery'

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

找到原因了,
webpack.base.conf.js 配置中写错了,在jquery后面多写了个'
plugins: [

new webpack.ProvidePlugin({
    $: "jquery",
    "window.jQuery": "jquery",
})

]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...