首先在

加入下面语句:
const webpack = require("webpack")
plugins: [
new webpack.ProvidePlugin({
jQuery:"jquery",
$:"jquery"
})
],
然后再在你需要的用到地方加入下面语句:
import $ from "jquery"
写自己的jqery语句:
mounted(){
$("ul li").on("click",function(){
$(this).addClass("active");
$('li').not($(this)).removeClass('active');
});
}
网友评论