declare常见用法
declare就是告诉TS编译器你担保这些变量和模块存在,并声明了相应类型,编译的时候不需要提示错误
declare就是告诉TS编译器你担保这些变量和模块存在,并声明了相应类型,编译的时候不需要提示错误
nrm
nrm(npm registry manager )是npm的镜像源管理工具。
一、nrm操作
1、全局安装nrm
npm install nrm -g --save
2、nrm有自带默认配置,*为当前的配置
nrm ls
npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
3、切换当前源地址
nrm use taobao
4、删除源地址
nrm del taobao
3、添加源地址
nrm add https://.**/
4、测试时间
nrm test npm
二、其他操作
1、直接安装cnpm
npm install cnpm -g --registry=https://registry.npm.taobao.org
2、直接更改源地址
npm set registry https://registry.npm.taobao.org/
3、查看npm源地址
npm config list
4、删除源地址
npm config rm registry
如果是获取子元素的第一个,不区分class 可以用 first-child
在容器中设置 flex-grow:2; overflow-y:auto;overflow-x:hidden;容器高度自适应。
内容高度不固定,无法出现滚动条,然后在容器中添加height:0,出现滚动条,个人猜想为设置height:0后,将默认的盒子模型高度设置为空,让flex设置的高度生效;
场景#
浏览器端需要存储一个用户的标识和cookie一样需要过期时间,但是用的是localStorage存储。而localStorage一经存储除非手动删除是不会过期的。那就需要自己实现过期机制。网上找了几种简单的方法。