工作中的解题思想(四)

  1. 提交commit的规范
type: commit 的类型
feat: 新特性
fix: 修改问题
refactor: 代码重构
docs: 文档修改
style: 代码格式修改, 注意不是 css 修改
test: 测试用例修改
chore: 其他修改, 比如构建流程, 依赖管理.
scope: commit 影响的范围, 比如: route, component, utils, build...
subject: commit 的概述, 建议符合  50/72 formatting
body: commit 具体修改内容, 可以分为多行, 建议符合 50/72 formatting
footer: 一些备注, 通常是 BREAKING CHANGE 或修复的 bug 的链接.
  1. 对Object.setPrototypeOf()和Object.getPrototypeOf()理解 a. Object.setPrototypeOf()的参考链接:https://blog.csdn.net/GXing007/article/details/79537059 b. Object.getPrototypeOf()方法可以用于从子类上获取父类
  2. git的使用 a. 对git的深刻理解的小游戏,参考链接:https://learngitbranching.js.org/ b. git多人协作流程,参考链接:https://www.git-tower.com/learn/git/ebook/cn/command-line/advanced-topics/git-flow c. git参考手册,参考链接:https://www.git-scm.com/book/zh/v2
  3. 移动端Vue组件库Vant ui
  4. 修改windows下面的hosts文件路径 改windows下面的hosts文件路径为: C:\Windows\System32\drivers\etc\hosts 在hosts文件下使用#就是注释符号
  5. 函数执行时定义实参变量的坑
console.log(o)  // 报错:o is not defined
      function test(obj){
        console.log(obj)
      }
      test(o={a:111})  // {a: 111}
      console.log(o)  // {a: 111}
      test(o)  // {a: 111}
  1. 函数同名形参
//  a. 在非严格模式下,函数中可以出现同名形参,且只能访问最后出现的该名称的形参
function add(x,x,x){
return x;
}
console.log(add(1,2,3));  //3
//  b. 在严格模式下,出现同名形参会抛出语法错误
function add(x,x,x){
'use strict';
return x;
}
console.log(add(1,2,3));  //SyntaxError: Duplicate parameter name not allowed in this context