yarn add jquery
添加以下配置:javascript
var webpack=require('webpack');
在 module.exports={}
添加以下配置:vue
plugins: [ new webpack.ProvidePlugin({ $:"jquery", jQuery:"jquery", "windows.jQuery":"jquery" }) ]
import $ from 'jquery'
// 这是jq的代码 $(function(){ $('.aui-content-main .aui-content-menu').hover(function(){ $(this).addClass('active').find('s').hide(); $(this).find('.aui-content-menu-dow').show(); },function(){ $(this).removeClass('active').find('s').show(); $(this).find('.aui-content-menu-dow').hide(); }); }); // 这是vue的js代码 export default {...}