Vue中使用jquery语句

首先在



加入下面语句:

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');
        });
}

你可能感兴趣的:(Vue中使用jquery语句)