环境安装及配置

工具安装

  1. nodejs安装:nodejs安装
    node -v、npm -v检查安装是否成功
  2. git安装:git下载
  3. vscode安装:vscode下载

vscode配置

  1. 常用快捷键配置
    设置-Keyboard Shortcuts,右上角进入json文件
    // Place your key bindings in this file to override the defaultsauto[]
    [
        {
            "key": "ctrl+x",
            "command": "-editor.action.clipboardCutAction",
            "when": "textInputFocus && !editorReadonly"
        },
        {
            "key": "ctrl+v",
            "command": "editor.action.clipboardPasteAction",
            "when": "textInputFocus && !editorReadonly"
        },
        {
            "key": "ctrl+d",
            "command": "editor.action.deleteLines",
            "when": "editorTextFocus"
        },
        {
            "key": "f12",
            "command": "editor.action.revealDefinitionAside",
            "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
        },
        {
            "key": "ctrl+k f12",
            "command": "-editor.action.revealDefinitionAside",
            "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
        },
        {
            "key":"ctrl+shift+/",
            "command": "editor.action.blockComment",
            "when": "editorTextFocus"
        }
    ]
    
  2. 字体大小设置
    设置-Settings,右上角进入json文件
    "editor.fontSize": 18,
    "terminal.integrated.fontSize": 18,
    "editor.tabSize": 4,
    
    修改侧边栏字体大小:
    打开VSCode安装目录下的如下文件:VSCode\resources\app\out\vs\workbench\workbench.desktop.main.css
    查找.part>.content
  3. 常用插件
    ESlint Vetur
    Git History
    GitLens //可以查看鼠标停留位置的代码提交信息
    open in browser
    Prettier //保存自动格式化代码
  4. 自动生成模板配置
    设置-User Snippets-搜索vue.json
    {
        "BaseTemp for Vue": {
         "prefix": "tem",
         "body": [
          "<template>",
          "<div class=\"$1$TM_FILENAME_BASE-container\">",
          " $TM_FILENAME_BASE",
          "</div>",
          "</template>",
          "",
          "<script>",
          "export default {",
          "    name: '$TM_FILENAME_BASE',",
          "",
          "}",
          "</script>",
          "",
          "<style lang='less' scoped>",
          "    .$1$TM_FILENAME_BASE-container {",
          "        ",
          "    }",
          "</style>",
         ],
         "description": "BaseTemp for Vue"
        }
    }
    

yarn安装

  1. npm安装:npm i yarn -g
  2. 当npm install yarn –g 全局安装yarn之后,输入yarn install报错,解决:
    搜索powershell,右键以管理员身份运行,执行:set-ExecutionPolicy RemoteSigned,选择是(Y)或者全是(A)
    查看执行策略:get-ExecutionPolicy,执行策略更改为 RemoteSigned

git拉取代码

  1. https方式:可以不用去git网站上配置SSH Key,但是克隆、提交和拉取分支代码都需要输入用户名和密码,比较麻烦(新手推荐用这个)。
  2. SSH方式:可以免密登录,git拉取代码和提交分支都可以免密,但是要去git网站上配置SSH Key,添加自己生产的公钥。
    (1)配置用户名:git config --global user.name “fantasy”
    配置邮箱:git config --global user.email “2928361059@qq.com”
    (2)生成公钥和私钥:ssh-keygen -t rsa -C “2928361059@qq.com”
    按3次Enter
    (3)查看公玥:cat ~/.ssh/id_rsa.pub
    (4)gitlab添加公玥:个人-settings-SSH Keys
    (5)测试配置是否正常:ssh -T git@192.168.1.105

nvm安装

  1. 安装前卸载已安装的nodejs
  2. 下载地址:https://github.com/coreybutler/nvm-windows/releases
    选择nvm-setup.zip安装
  3. 解压之后安装,默认是C盘,可自定义安装路径
  4. 找到安装文件,在settings.txt文件里添加以下两行命令:
    node_mirror: https://npm.taobao.org/mirrors/node/
    npm_mirror: https://npm.taobao.org/mirrors/npm/
  5. 管理员身份运行cmd
    nvm -v :查看版本号
    nvm list 或 nvm ls :查看已安装的node版本
    nvm list available : 显示所有可下载的版本
    nvm install 版本号 :安装指定node版本
    nvm use 版本号 :切换到指定版本号
    nvm current :查看当前使用的版本
    nvm uninstall 版本号 :删除指定node版本
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值