vue-cli添加jquery

在webpack.base.conf.js的顶部加入jquery

var webpack = require("webpack")webpack

在module.exports的最后加入web

plugins: [ide

  //经过ProvidePlugin引入的插件,不须要import引入就能够直接使用
  new webpack.ProvidePlugin({
    jQuery: "jquery",
    $: "jquery"
  })
]ui

而后必定要从新 run dev插件

相关文章
相关标签/搜索