返回顶部

【Vue】开发环境搭建

Vue开发环境

webstorm

IDE,推荐后端人员使用,因为webstorm和pycharm是同一家公司的产品

因为webstorm需要注册,通常也会使用VS CODE 或者 sublime , 核心内容是需要语法高亮

nodejs

下载地址:https://nodejs.org/en/download/

cnpm

安装node.js会同时安装npm,使用npm -v 查看对应版本,这里使用cnpm代替npm,因为有时候用npm下载东西比较卡

1.cnpm代替npm
$ npm install -g cnpm --registry=https://registry.npm.taobao.org

2.安装模块
$ cnpm install [name]

3.运行项目
$ cnpm run dev

 

git

1.使用基于git的代码管理工具,我这里用的是码云:https://gitee.com/

2.根据提示在码云创建私有仓库

3.git 官网安装 git https://git-scm.com/

4.本地打开终端

  git --version

5.码云帮助文档配置SSH

https://gitee.com/help/articles/4181

 

vue-cli

#全局安装vue-cli
$ cnpm install  --global vue-cli 

#创建一个基于webpack模板的新项目
$ vue init webpack wherego(项目位置文件夹)

> Target directory exists. Continue? Yes # wherego文件夹已存在,是否继续,yes
> Project name wherego # 项目名称,首字母不能大写
> Author zhangw<123456@qq.com> #作者,名字+邮箱,邮箱可以不写
>1 Runtime + Compiler: recommended for most users #运行时和普通情况都编译,通常选这个
>2 Runtime-only: about 6KBlighter min+gzip,...太长省略... #运行时编译
> Install vue-router? y #下载vue路由,通常会用到
> Use ESLint to lint your code? y # 是否使用ESlint检查代码工整度,yes
> Pick an ESLint preset Standard #检查规范选第一个,standard
> Set up unit tests n #是否进行单元测试,根据实际情况选择
> Setup e2e tests with Nightwatch? #是否进行端到端的测试,根据实际情况选择
> Should we run 'npm install' for you after the project has been created? # 选择Yes,use npm


项目初始化完成后,文件内容如下:

 

 

git-bash 推送本地代码到码云

git status # 查看当前仓库状态变化
git add .  #加载所有文件到本地的缓冲区
git commit -m 'first commit' #commit
git push #推送

 

posted @ 2020-03-01 20:27  Will_D_Zhang  阅读(255)  评论(0编辑  收藏  举报