博客园 - hiuman
uuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=185618
2022-05-07T10:24:25Z
hiuman
https://www.cnblogs.com/hiuman/
feed.cnblogs.com
https://www.cnblogs.com/hiuman/p/16243700.html
ES9 命名捕获组 - hiuman
命名捕获组 在一些正则表达式模式中,使用数字进行匹配可能会令人混淆。例如,使用正则表达式/(\d{4})-(\d{2})-(\d{2})/来匹配日期。因为美式英语中的日期表示法和英式英语中的日期表示法不同,所以很难区分哪一组表示日期,哪一组表示月份: const re = /(\d{4})-(\d{
2022-05-07T10:23:00Z
2022-05-07T10:23:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】命名捕获组 在一些正则表达式模式中,使用数字进行匹配可能会令人混淆。例如,使用正则表达式/(\d{4})-(\d{2})-(\d{2})/来匹配日期。因为美式英语中的日期表示法和英式英语中的日期表示法不同,所以很难区分哪一组表示日期,哪一组表示月份: const re = /(\d{4})-(\d{ <a href="https://www.cnblogs.com/hiuman/p/16243700.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/16117574.html
拿到今天往后 最近的 多个 周几 - hiuman
方法及例子如下: 比如拿到今天往后 最近的 5个 周二(不包括今天) 参数: weekday 是周几,参数范围是 0 - 6,0 代表周日 num 是个数 startDay 是开始计算的时间,是时间戳 function getDays(weekday, num, startDay, lastResu
2022-04-08T07:47:00Z
2022-04-08T07:47:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】方法及例子如下: 比如拿到今天往后 最近的 5个 周二(不包括今天) 参数: weekday 是周几,参数范围是 0 - 6,0 代表周日 num 是个数 startDay 是开始计算的时间,是时间戳 function getDays(weekday, num, startDay, lastResu <a href="https://www.cnblogs.com/hiuman/p/16117574.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/16113827.html
使用正则表达式 匹配 HTML 标签内的内容 - hiuman
使用正则表达式 匹配 HTML 标签内的内容 正则表达式如下 /(?<=((<[a-zA-Z-]+?){0,1}>))([\s\S]+)(?=([\s]{0,1}<\/[a-zA-Z-]+(>{0,1})))/g 测试例子: var regexp = /(?<=((<[a-zA-Z-]+?){0,1
2022-04-07T11:13:00Z
2022-04-07T11:13:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】使用正则表达式 匹配 HTML 标签内的内容 正则表达式如下 /(?<=((<[a-zA-Z-]+?){0,1}>))([\s\S]+)(?=([\s]{0,1}<\/[a-zA-Z-]+(>{0,1})))/g 测试例子: var regexp = /(?<=((<[a-zA-Z-]+?){0,1 <a href="https://www.cnblogs.com/hiuman/p/16113827.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/14178651.html
JavaScript判断变量的类型 - hiuman
1. 通过typeof来判断 2. 通过instanceof来判断 或 通过constructor来判断 3. null直接全等判断即可 4. 万能判断方式:Object.prototype.toString.call() 1. 通过typeof来判断 typeof undefined // und
2020-12-23T06:57:00Z
2020-12-23T06:57:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】1. 通过typeof来判断 2. 通过instanceof来判断 或 通过constructor来判断 3. null直接全等判断即可 4. 万能判断方式:Object.prototype.toString.call() 1. 通过typeof来判断 typeof undefined // und <a href="https://www.cnblogs.com/hiuman/p/14178651.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/14178530.html
用JS创建10个<a>标签,点击的时候弹出来对应的序号 - hiuman
利用闭包的方式 for (var i = 0; i < 10; i++) { var aObj = document.createElement('a') aObj.innerText = 'a标签' + i aObj.onclick = (function (i) { return functio
2020-12-23T06:41:00Z
2020-12-23T06:41:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】利用闭包的方式 for (var i = 0; i < 10; i++) { var aObj = document.createElement('a') aObj.innerText = 'a标签' + i aObj.onclick = (function (i) { return functio <a href="https://www.cnblogs.com/hiuman/p/14178530.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/14060435.html
【工具】根据后端提供的swagger生成前端的axios请求配置文件/api - hiuman
根据后端提供的 swagger 生成配置文件(JavaScript 文件)【简单的说,就是生成 api 目录】 旧标题:【工具】根据后端提供的swagger生成前端的axios请求配置文件/api github 地址在这里:https://github.com/littleHiuman/Gene
2020-11-30T03:46:00Z
2020-11-30T03:46:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】 根据后端提供的 swagger 生成配置文件(JavaScript 文件)【简单的说,就是生成 api 目录】 旧标题:【工具】根据后端提供的swagger生成前端的axios请求配置文件/api github 地址在这里:https://github.com/littleHiuman/Gene <a href="https://www.cnblogs.com/hiuman/p/14060435.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/13895953.html
JavaScript正则表达式-零宽断言 - hiuman
介绍: 零宽断言的意思是(匹配宽度为零,满足一定的条件/断言) 零宽断言用于查找在某些内容(但并不包括这些内容)之前或之后的东西,也就是说它们像\b,^,$那样用于指定一个位置,这个位置应该满足一定的条件(即断言)。 分类: 零宽断言分为两类: 1. 正向零宽断言 2. 负向零宽断言 零宽断言分为四
2020-10-29T03:57:00Z
2020-10-29T03:57:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】介绍: 零宽断言的意思是(匹配宽度为零,满足一定的条件/断言) 零宽断言用于查找在某些内容(但并不包括这些内容)之前或之后的东西,也就是说它们像\b,^,$那样用于指定一个位置,这个位置应该满足一定的条件(即断言)。 分类: 零宽断言分为两类: 1. 正向零宽断言 2. 负向零宽断言 零宽断言分为四 <a href="https://www.cnblogs.com/hiuman/p/13895953.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/13890795.html
JavaScript中数组去重、对象去重的方法 - hiuman
ES6提供了新的数据结构:Set 和 Map,在写去重代码时方便了很多人,可以用更少的代码去实现去重。 这两者都是构造函数,需要通过new去生成。 这两者的区别就是:Set类似于数组,Map类似于对象 数组去重 const array = [1, 2, 3, 4, 5, 5, 5, 5] const
2020-10-28T06:12:00Z
2020-10-28T06:12:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】ES6提供了新的数据结构:Set 和 Map,在写去重代码时方便了很多人,可以用更少的代码去实现去重。 这两者都是构造函数,需要通过new去生成。 这两者的区别就是:Set类似于数组,Map类似于对象 数组去重 const array = [1, 2, 3, 4, 5, 5, 5, 5] const <a href="https://www.cnblogs.com/hiuman/p/13890795.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/12436339.html
收集的无版权图片网站(欢迎补充) - hiuman
我存在github上了,欢迎收藏、star、补充、分享阿~~~ 地址在这里:https://github.com/littleHiuman/Copyright-free-picture-website/blob/master/README.md 正文: Unsplash https://unspla
2020-03-07T11:18:00Z
2020-03-07T11:18:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】我存在github上了,欢迎收藏、star、补充、分享阿~~~ 地址在这里:https://github.com/littleHiuman/Copyright-free-picture-website/blob/master/README.md 正文: Unsplash https://unspla <a href="https://www.cnblogs.com/hiuman/p/12436339.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/12228044.html
css 清除浮动 - hiuman
在子元素都设置了浮动后,父元素会失去高度。 而且会影响下面的元素,这时候就需要清除浮动: 这时候就需要清除浮动: 1. 在这些子元素的最后加一个元素来清除浮动 2. 通过父类的伪元素:after来清除浮动 3. 给接下来的第一个元素增加 clear:both; 样式(即不希望受到影响的元素) 4.
2020-01-22T02:32:00Z
2020-01-22T02:32:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】在子元素都设置了浮动后,父元素会失去高度。 而且会影响下面的元素,这时候就需要清除浮动: 这时候就需要清除浮动: 1. 在这些子元素的最后加一个元素来清除浮动 2. 通过父类的伪元素:after来清除浮动 3. 给接下来的第一个元素增加 clear:both; 样式(即不希望受到影响的元素) 4. <a href="https://www.cnblogs.com/hiuman/p/12228044.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/12189608.html
JavaScript+CSS+HTML 编写手风琴效果 - hiuman
效果图: 可以通过 https://littlehiuman.github.io/03-Accordion/ 查看效果。 https://github.com/littleHiuman/littleHiuman.github.io 求点star~~~ 代码如下: * { margin: 0; pad
2020-01-13T15:46:00Z
2020-01-13T15:46:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】效果图: 可以通过 https://littlehiuman.github.io/03-Accordion/ 查看效果。 https://github.com/littleHiuman/littleHiuman.github.io 求点star~~~ 代码如下: * { margin: 0; pad <a href="https://www.cnblogs.com/hiuman/p/12189608.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/12024429.html
Mac定制终端:iTerm2 + zsh + powerline - hiuman
原始界面: 配置后的界面: 安装iTerm2 可以直接去官网下载:https://www.iterm2.com/ 下载后直接安装即可 安装主题 所有主题:https://iterm2colorschemes.com/ 我使用的是吸血鬼主题,具体下载方式,去官网:https://draculathem
2019-12-11T10:51:00Z
2019-12-11T10:51:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】原始界面: 配置后的界面: 安装iTerm2 可以直接去官网下载:https://www.iterm2.com/ 下载后直接安装即可 安装主题 所有主题:https://iterm2colorschemes.com/ 我使用的是吸血鬼主题,具体下载方式,去官网:https://draculathem <a href="https://www.cnblogs.com/hiuman/p/12024429.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/12018498.html
JavaScript 类型转换 - hiuman
这里主要讲的是将其他的数据类型转换成Number、String、Boolean类型,欢迎补充~! 转换成Number类型 1. Number()函数,如: var a = "123"; a = Number(a); 1.1 如果是纯数字的字符串,则直接将其转换为数字;如果字符串中有非数字的内容,则转
2019-12-10T10:56:00Z
2019-12-10T10:56:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】这里主要讲的是将其他的数据类型转换成Number、String、Boolean类型,欢迎补充~! 转换成Number类型 1. Number()函数,如: var a = "123"; a = Number(a); 1.1 如果是纯数字的字符串,则直接将其转换为数字;如果字符串中有非数字的内容,则转 <a href="https://www.cnblogs.com/hiuman/p/12018498.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/11238194.html
安装依赖的时候,报错npm WARN checkPermissions - hiuman
解决办法1 。 删除node_modules文件夹,重新安装依赖。 解决办法2 。 统一使用同一个npm安装依赖 。 原因:有的依赖包是用npm安装的,有的依赖包是用cnpm安装的。
2019-07-24T07:18:00Z
2019-07-24T07:18:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】解决办法1 。 删除node_modules文件夹,重新安装依赖。 解决办法2 。 统一使用同一个npm安装依赖 。 原因:有的依赖包是用npm安装的,有的依赖包是用cnpm安装的。 <a href="https://www.cnblogs.com/hiuman/p/11238194.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/11225541.html
JavaScript 获取随机整数 - hiuman
Math.random()方法会返回介于 0(包含) ~ 1(不包含) 之间的一个随机数 假如想要拿到0-10之间的数,只需要将该方法的值*10 即Math.random()*10; 假如想要拿到0-20之间的数,同理,只需要将该方法的值*20 即Math.random()*20; 那么,想要拿到0
2019-07-22T06:13:00Z
2019-07-22T06:13:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】Math.random()方法会返回介于 0(包含) ~ 1(不包含) 之间的一个随机数 假如想要拿到0-10之间的数,只需要将该方法的值*10 即Math.random()*10; 假如想要拿到0-20之间的数,同理,只需要将该方法的值*20 即Math.random()*20; 那么,想要拿到0 <a href="https://www.cnblogs.com/hiuman/p/11225541.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/10609245.html
HTML+CSS+JS(+Vue)写一个通讯录组件 - hiuman
求各位大大的Star(*/ω\*)。 没有录屏,所以上传的是图片。后面已补充录屏效果。 效果:(主要是参考小米Note3的通讯录的效果做的) 主要功能: 1. 滚动后,通讯录的模块标题会固定在顶部(图2) 2. 下一个标题很接近时,将上一个标题推上去的效果(过程:图3、图4、图5) 实现: 1. 模
2019-03-27T09:47:00Z
2019-03-27T09:47:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】求各位大大的Star(*/ω\*)。 没有录屏,所以上传的是图片。后面已补充录屏效果。 效果:(主要是参考小米Note3的通讯录的效果做的) 主要功能: 1. 滚动后,通讯录的模块标题会固定在顶部(图2) 2. 下一个标题很接近时,将上一个标题推上去的效果(过程:图3、图4、图5) 实现: 1. 模 <a href="https://www.cnblogs.com/hiuman/p/10609245.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/9636182.html
常见问题 解决合集 - hiuman
会持续更新 欢迎一起探讨,如果有写的不准确或是不正确的地方,欢迎大家指出来~ 或者有更好的解决办法也可以提出来~ 略长,建议直接搜关键字/词 如果没有你想要的内容,可以点这里去评论,或者发短消息给我,后续会继续补充 HTML: 跳转页面某个位置:(使用锚点) 可编辑 contenteditable属
2018-09-14T07:05:00Z
2018-09-14T07:05:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】会持续更新 欢迎一起探讨,如果有写的不准确或是不正确的地方,欢迎大家指出来~ 或者有更好的解决办法也可以提出来~ 略长,建议直接搜关键字/词 如果没有你想要的内容,可以点这里去评论,或者发短消息给我,后续会继续补充 HTML: 跳转页面某个位置:(使用锚点) 可编辑 contenteditable属 <a href="https://www.cnblogs.com/hiuman/p/9636182.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/9543792.html
构造函数、原型对象prototype、实例、隐式原型__proto__的理解 - hiuman
(欢迎一起探讨,如果有什么地方写的不准确或是不正确也欢迎大家指出来~) PS: 建议将构造函数中的方法都定义到构造函数的原型中,那么由该构造函数创建的实例的方法都会指向同一个方法。(在构造函数内部声明的话,每创建一个实例都会重新实例化函数,那么每个实例中的函数的指向是不同的;如果定义在全局作用域中,
2018-08-28T10:40:00Z
2018-08-28T10:40:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】(欢迎一起探讨,如果有什么地方写的不准确或是不正确也欢迎大家指出来~) PS: 建议将构造函数中的方法都定义到构造函数的原型中,那么由该构造函数创建的实例的方法都会指向同一个方法。(在构造函数内部声明的话,每创建一个实例都会重新实例化函数,那么每个实例中的函数的指向是不同的;如果定义在全局作用域中, <a href="https://www.cnblogs.com/hiuman/p/9543792.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/7340563.html
react项目中遇到的一些问题 - hiuman
推荐使用facebook官方构建工具create-react-app来创建React基础工程。(然而我还是手动构建) (路由)官方旧版本和V4的比较。https://github.com/ReactTraining/react-router/blob/master/packages/react-ro
2017-08-24T11:33:00Z
2017-08-24T11:33:00Z
hiuman
https://www.cnblogs.com/hiuman/
【摘要】推荐使用facebook官方构建工具create-react-app来创建React基础工程。(然而我还是手动构建) (路由)官方旧版本和V4的比较。https://github.com/ReactTraining/react-router/blob/master/packages/react-ro <a href="https://www.cnblogs.com/hiuman/p/7340563.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hiuman/p/7277450.html
常见移动web注意点 - hiuman
该文被密码保护。
2017-08-12T05:01:00Z
2017-08-12T05:01:00Z
hiuman
https://www.cnblogs.com/hiuman/
该文被密码保护。