Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在vue中引用jQuery库 #6

Open
zuobaiquan opened this issue Nov 7, 2017 · 0 comments
Open

在vue中引用jQuery库 #6

zuobaiquan opened this issue Nov 7, 2017 · 0 comments

Comments

@zuobaiquan
Copy link
Owner

zuobaiquan commented Nov 7, 2017

1.安装jquery依赖

国内镜像安装

npm install -g cnpm --registry=https://registry.npm.taobao.org

npm install jquery --save

2.修改webpack配置文件

找到 webpack.base.conf.js文件

①. 引入webpack
var webpack = require("webpack")

② module.exports
加上

// 增加一个plugins
 plugins: [
    new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery"
    })
 ]
  1. 重新 执行 npm run dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant