vue-cli3.0开发上路

Vue Cli 3.0

参看文档https://cli.vuejs.org/zh/guide/

Vue cli 安装

node版本使用新的版本,10.0.x。
npm install -g @vue/cli
npm install -g @vue/cli-service-global
npm install -g @vue/cli-init

初始化项目

创建一个项目
vue create hello-world

添加路由和状态存储
vue add route
vue add vuex

引入element

目录下面执行
vue add element

此时执行npm run serve发现添加了一个element的按钮。

引入bootstrap

vue add bootstrap

引入jquery

npm install -S jquery

添加文件vue.config.js,文件内容如下:
// vue.config.js
const webpack = require(‘webpack’)
module.exports = {
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: ‘jquery’,
jquery: ‘jquery’,
‘window.jQuery’: ‘jquery’,
jQuery: ‘jquery’,
})
]
},
}

猜你喜欢

转载自blog.csdn.net/qq_27075573/article/details/87877658