重点:text-overflow: ellipsis;只对display:inline;起作用
//一行white-space: nowrap;text-overflow: ellipsis;overflow: hidden;word-break: break-all;//两行display: -webkit-box;overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp: 2;/* autoprefixer: ignore next */-webkit-box-orient: vertical;
npm i 速度提升
- npm install —production 或者 NODE_ENV=production npm install
- 设置npm仓库 npm config set registry http://registry.npm.taobao.org/ 或者 在~/.npmrc 文件写入
- 缓存 npm install —prefer-offline
- travis ci 配置缓存 ``` install: -npmci
cache: dirctories: -“$HOME/.npm”
5. npm set process=false 不打印进度6. 用 npm ci<a name="rDZNu"></a># 保障动作标准流程系统可用性的Review,主要分为事前、事中、事后:<br />1. 事前依赖流程与规范,包括代码规范、分支规范、测试规范、上线规范等。如果没有百分百的把握,不要上线。上线,标准一定明确的,模棱两可的上线,大概率会出现问题。2. 事中依赖监控与降级,可以设计一些监控和降级的方案。对于不可降级的要做好事前的预案,同时也依赖于演练的频率。演练的次数多了,就可以通过熟练的操作,降低服务受影响的时间,间接提高服务的可用性。3. 事后依赖执行力,要做可落地的Case Study。很多同学都是在事后复盘的时,说这次没有做好,代码写错了,没有太注意,这是别人的问题等等,草草就结束了。但是对下次事故来说,并没有预防的动作和可落地的执行方案。这就要求执行力,也看解决问题的决心<a name="gx9cd"></a># node-sass 安装失败解决方法```bashnpm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/// 也可以设置系统环境变量的方式。示例// linux、mac 下SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass// window 下set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ && npm install node-sass// 设置全局镜像源npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/// 安装失败后重新安装问题npm uninstall node-sass && npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
git 回滚代码
删除远程分支再提交
git reset --hard resetVersionHash //将当前branch的HEAD指针指向commit hashgit push origin --delete currentBranchgit push origin currentBranch
强制push 远程分支
git reset --hard resetVersionHashgit push -f origin currentBranch
从回滚位置生成新的commit hash
git revert resetVersionHash //git revert是以要回滚的commit hash(1c0ce98)为基础,新生成一个commit hash(01592eb)git push origin currentBranch
劫持浏览器返回事件
```javascript window.history.pushState({}, ‘至造云课堂’) // 要先pushState才能触发 popstate window.addEventListener(‘popstate’, toHome, false) window.removeEventListener(‘popstate’, toHome, false)
function toHome() { //去首页 console.log(‘去首页’) // window.location.href = ‘/‘ uni.reLaunch({ url: ‘/pages/index/index’, }) } ```
