美文网首页
新建vue项目

新建vue项目

作者: 小小_绿 | 来源:发表于2018-08-01 14:19 被阅读0次

    一. vue-cli初始化

    1. 全局安装 vue-cli

    npm install --global vue-cli

    2. 创建一个基于 webpack 模板的新项目

    vue init webpack my-project

    本步骤会有

    Project name manager-web

    ? Project description A Vue.js project

    ? Author llz

    ? Vue build standalone

    ? Install vue-router? Yes

    ? Use ESLint to lint your code? No  //eslint测试插件

    ? Set up unit tests No   //是否安装单元测试

    ? Setup e2e tests with Nightwatch? No  //是否e2etests

    ? Should we run `npm install` for you after the project has been created? (recom

    mended) npm

    3. 安装依赖

    cd my-project

    npm install (换源安装: npm install --registry https://registry.npm.taobao.org )

    npm run dev

    二、安装依赖插件,可在package.json文件直接添加,也可,直接用命令行添加依赖插件

    1. 两种依赖包的安装方式 (新建项目vue-cli初始化步骤中已完成)

    1.1 项目依赖包

    npm install --save vue

    1.2 开发依赖包

    npm install --save-dev webpack

    2. less依赖包

    npm install --save-dev less less-loader

    3. 网络请求axios依赖包

    npm install --save axios

    4. axios低版本浏览器补丁es6-promise依赖包

    npm install --save es6-promise

    5. 路由安装

    npm install --save vue-router

    6. 状态管理安装

    npm install --save vuex

    7. PC端组件库

    npm install --save element-ui

    8. 移动端组件库

    npm install --save mint-ui

    9. 上传服务器ssh2

    npm install –save-dev ssh2

    10. cookie封装库

    npm install --save js-cookie

    相关文章

      网友评论

          本文标题:新建vue项目

          本文链接:https://www.haomeiwen.com/subject/zmtrvftx.html