您的位置:首页 > Web前端 > JQuery

在vue里使用 jquery

2017-12-10 13:20 225 查看

在vue里使用 jquery

开发工具:vs Code 使用iview的UI框架

用cnpm(推荐)或者npm 安装jquery插件

1. cnpm install jquery –save



2.在webpack.base.config.js文件中加入

(1)const webpack = require(‘webpack’);



(2)plugins: [

new webpack.ProvidePlugin({

$: ‘jquery’,

jQuery: ‘jquery’

})

]



(3)resolve: {

alias:{

‘jquery’: ‘jquery’

}

}



3.在main.js中加入

// jquery

import $ from ‘jquery’;

Vue.use($);

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vue jquery vscode iview npm