在index.html引入
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
配置文件
vue.config.js
代码如下:
module.exports = {
configureWebpack:{
externals: {
'jquery' : '$',
}
},
};
本文介绍如何在Vue项目中引入并配置jQuery,通过在index.html中加入jQuery库,并在vue.config.js中进行externals配置,实现jQuery与Vue项目的无缝对接。
在index.html引入
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
配置文件
vue.config.js
代码如下:
module.exports = {
configureWebpack:{
externals: {
'jquery' : '$',
}
},
};
1420
1332

被折叠的 条评论
为什么被折叠?