How to use vue scaffolding project introduced JQuery

1: Download jquery

npm install jquery --save

2: Open webpack.base.conf.js build file folder, add the above:

 var webpack=require('webpack')

  In module.exports enter:

        plugins: [ 
           new webpack.ProvidePlugin({ 
                 $:"jquery", 
                 jQuery:"jquery", 
                "windows.jQuery":"jquery"
        }) 
      ], 

3: Enter inlet file in main.js

import $ from 'jquery'

Guess you like

Origin www.cnblogs.com/sylys/p/12020697.html