`
文章列表
1. tsconfig配置了noUnusedLocals: true检查代码,提示 "xxx" is declared but its value is never read. 如果确定不得不定义变量但是还不需要使用时, 可以以 "_xxx" 的方式命名变量,那么TSLint就不会提示这个变量了.   2. 使用 "// @ts-ignore" 注释可以关闭下面一行的TS的提示.   3. ts文件中使用以下注释来临时忽略TSLint规则导致的错误提示 tslint:disable /——忽略该行以下所有代码出现的错误 ...
新安装的Jenkins,首次登录有一个配置向导。在选择安装推荐的插件时,由于速度太慢,导致超时,总是报错。按照解决方案https://issues.jenkins-ci.org/browse/JENKINS-46776 需要设置超时时间。设置的方法可以在浏览器的sources界面打开pluginSetupWizard.js 文件。由于这个文件是压缩过的,所以需要格式化一下。  从浏览器的网络连接里面可以看到是“/pluginManager/plugins” 带这个路径的请求超时,所以在wizard js文件中搜索“/pluginManager/plugins”, 然后设置断点,将timeou ...
写Angular的UT,经常要spyOn某些service的方法,防止发送网络请求。在spec文件和普通文件中引入类的方式不同,就会导致spyOn不起作用,代码依然调用没有mock掉的方法,比如 spec中使用 '../../../libs/xxxx' 这种相对路径引入文件 普通文件中使用 ’libs/xxxx' 这种方式引入文件
  .progress-bar-container { background-color: gray; height: 10px; width: 120px; border-radius: 5px; overflow: hidden; .progress-bar { height: 10px; background-color: green; } }   <div class="progress-bar-container"> <div [style.width]=&quo ...

Vue的技术细节总结

    博客分类:
  • Vue
Vue的版本是^2.6.10 vue-router的版本是^3.0.3 vue-/cli-service的版本是^3.8.0   1. cli创建的默认工程,route对应的component option里面,使用了字符串template, 访问时会报如下错误: [Vue warn]: You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or u ...
网上找的中文的例子都不靠谱,还得是英文网站好用。 网址: https://www.movable-type.co.uk/scripts/latlong.html   Haversine formula Using Chrome on a middling Core i5 PC, a distance calcula­tion takes around 2 – 5 micro­seconds (hence around 200,000 – 500,000 per second). Little to no benefit is obtained by factoring out com ...
有两个方式建立NodeJS的项目的job   1. 不需要安装任何插件 1) 在Manage Jenkins -> Configurate System -> Global properties里面,勾选Environment variables,name填写PATH,value填写nodejs的安装目录C:\work\software\nodejs 2) 建立freestyle的job。 Source Code Management填写http方式的git url,credentials部分设置用户名和密码,Branches to build设置好要用的branch例 ...
在windows上的Jenkins上创建一个job,去build一个Maven Project。可以按照以下方式配置   1. 安装Config File Provider Plugin 安装之后,可以将自己的settings.xml文件通过这个插件添加到Jenkins里。   2. 安装Maven Integration插件 安装这个插件之后,在new item里面可以看到Maven Project的选项。通过这个选项创建Maven Project的job,就会有特定的参数可以配置   3. 在Manage Jenkins -> Configure System里面, ...

Jenkins基础知识

Jenkins的声明式脚本Pipeline的基本知识 1. Section agent,post,stages,steps steps里必须包含至少一个step。每一行语句就是一个step。 2. Directive environment, options, parameters, stage, when, triggers, input, tools options, parameters, triggers他们要把可用的option, parameter, trigger都包在block里,然后用()调用。 比如:   options {     disableRes ...
In CMD, run "rundll32 sysdm.cpl,EditEnvironmentVariables" command. Edit environment property in pop-up window. It is system level.
PlantUML教程中(http://s.plantuml.com/PlantUML_Language_Reference_Guide_ZH.pdf),4.5更多分支一节,代码如下:   @startuml (*) --> if "Some Test" then -->[true] "activity 1" if "" then -> "activity 3" as a3 else if "Other test" then -left-> " ...
写Angular UT总是犯低级错误,烦躁!   当第一个it跑完之后,第二个it跑之前,会执行component的清理操作。会调用component的ngOnDestroy方法!!!如果只有第一个it而不存在第二个it,那么就不会执行cleanup, 就不会调用ngOnDestroy方法!!! const component; beforeEach(() => { store = TestBed.get(Store); fixture = TestBed.createComponent(AComponent); component = fix ...
在Resolver里面获取数据,一般可以像下面这样写   resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> { return this.store.pipe( select(selectXXX), tap((data) => { if (!data) { // 自行根据实际做判断 // Dispatch action to load data. this.store.di ...
本地有两个工程,一个Angular4的UI工程,使用Jest和Jasmine做单元测试,jest会出code coverage报告。一个后台Node工程,JS编写,用Jasmine做单元测试,istanbul出code coverage报告。 项目需要集成Sonar进行代码检查。   步骤: 1. 下载安装并启动SonarQube https://docs.sonarqube.org/display/SONAR/Get+Started+in+Two+Minutes 如果运行遇到什么问题了,可以尝试完全删除再重新解压。正常的话,只需要按照说明解压运行就可以了。 SonarQube ...
正则表达式里面,表示或者用 “(xxxx|yyyy)”表示。 分组也使用括号表示。 如果用match函数执行一下带分组和“或者”关系的正则表达式,可以看出来“或者”关系的语法也被认为是一个分组。   正则: /.*(\/.*)\/\(((.*)\/\/|(.*)\)$)/   URL:  http://localhost:3002/part1/(part2//popup:pop) Match Group:  ["http://localhost:3002/part1/(part2//", "/part1", "part2//& ...
Global site tag (gtag.js) - Google Analytics