Vue-cli introduces jquery to report several errors, but it does not affect its use.

The

project uses some jq plug-ins and relies on jq to run, so jq

is introduced.

webpack.base.conf.js

plugins: [
    new webpack.optimize.CommonsChunkPlugin("common.js"),
    new webpack.ProvidePlugin({
      jQuery: "jquery",
      $: "jquery"
    })
  ],

index.html

because of the use of layer.js, jquery and layer are directly introduced into html

.
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>octet</title>
    <script src="./static/js-spark-md5.js"></script>
    <script src="./static/jquery-2.1.4.js"></script>
    <script src="./static/layer/layer.js"></script>
  </head>
  <body>
  <!--<body data-spy="scroll" data-target="-sharpsidebar">-->
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

but the browser reported the following error and did not find the reason for it for a long time

main.js has been added

new Vue({
  el: "-sharpapp",
  store,
  router,
  template: "<router-view></router-view>",
  // components: {template: "<router-view></router-view>"}
})

clipboard.png


vue does not have new in main.js.


resolved, comment out

in main.js
import $ form 'jquery'
Menu