美文网首页我爱编程
环境搭建~Vue CLI

环境搭建~Vue CLI

作者: 晨曦墨angel | 来源:发表于2018-06-07 14:26 被阅读0次

1.安装Node.js

 终端工具( windows   cmd)

 命令行: 指令:1)node -v(查看安装的Node版本)

                           2)npm -v (Node 管理包) 检查Node检查没有问题

2.码云账号:(晨曦墨,1609716621)

 1)主页 --Private --点击+ 创建私有的仓库 --(项目名称,语言:Javascript 、添加gitignore 、添加开源许可证:MIT License 私有、使用Readme----创建

 2)安装git-- 指令:git --version (git 的版本) 

 3)通过git关联 个人设置:SSH公钥:如何生成公钥 指令:桌面右击-- git bash(相当于Linux终端)

 执行命令:

(1) ssh-keygen -t rsa -C "1609716621@qq.com"     注册邮箱保持一直(生成公钥或者私钥) (2) cat ~/.ssh/id_rsa.pub  (查看) 

 4)从线上克隆到线下:

         方法一:选择SSH 复制地址 --在桌面终端(切换文件夹:cd~项目所在文件夹)--指令:git clone 地址 

         方法二:直接在项目所在的文件夹--右击启动git bash--再操作 

 5)线下提交到线上: 查看:git status 本地仓库多出来很多文件 添加:git add . (添加到缓冲区) ----git commit -m 'project initialized' ---git push

 3.创建vue项目:(Vue CLI )

(参考文章:https://blog.csdn.net/ABAP_Brave/article/details/77852623) 

 1)全局安装:$ npm install -g vue-cli 执行vue命令查看安装是否成功:

$ vue Usage: vue[options]显示:

 Options:

 -V, --version output the version number

 -h, --help output usage information

 Commands: 

 init     generate a new project from a template

 list      list available official templates

 build       prototype a new project

 help       [cmd] display help for [cmd]

 命令:vue list 查看可用模板

 2)创建项目:

使用webpack模板指令: $ vue init webpack HelloVue(项目所在文件夹)

? Project name hellovue 回车// 工程名称(小写)

? Project description hellovue // 工程描述,会在README.md文件生成输入的内容

? Author wangzhen <376086383@qq.com> // 作者,如果有git,就是读取git的User信息

? Vue build standalone

? Install vue-router? Yes // 否安装Vue路由

? Use ESLint to lint your code? Yes // ESLint管理代码(ES6代码风格检查器)

? Pick an ESLint preset Standard // ESlint-类型

? Setup unit tests with Karma + Mocha? No // 使用单元测试工具karma和mocha 默认是

? Setup e2e tests with Nightwatch? No // 使用e2e测试框架

 NightWatch 默认是

 vue-cli · Generated "HelloVue". 

 To get started: 

 cd HelloVue 

 npm install npm run dev 

 Documentation can be found at https://vuejs-templates.github.io/webpack

 3)运行VUE程序:

To get started:

 cd HelloVue

 npm install

 npm run dev 

 Documentation can be found at https://vuejs-templates.github.io/webpack:

相关文章

网友评论

    本文标题:环境搭建~Vue CLI

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