周凯,个人博客

  • 前端
  • 嵌入式
  • 工具
  • 后端
  • 随笔
个人记录
javascript

分组切分数组,一维数组变为二位数组

/** * 分组切分数组,一维数组变为二位数组 * @param data * @param size 切分个数 * @returns {*[]} */ splitArray(data, size) { const groupedData = []; for (let i = 0; i < data.length; i += size) { let end = i + size; if (end > data.length) { end = data.length; } groupedData.push…

2023年 7月 21日 0条评论 676点热度 0人点赞 周凯 阅读全文
前端

scss常用方法

新建comm.scss文件 @mixin flex($direction: row, $justify-content: center, $align-items: center) { display: flex; flex-direction: $direction; justify-content: $justify-content; align-items: $align-items; } 然后,在你的主Sass文件中,使用@include引入 flex .selector { @include flex(r…

2023年 7月 11日 0条评论 601点热度 0人点赞 周凯 阅读全文
工具

npkill轻松查找和删除旧的和占体积的node_modules文件夹✨

github地址:https://github.com/voidcosmos/npkill 官网地址:https://npkill.js.org/ 安装:npm i -g npkill 直接执行 npkill就可以 默认情况下,npkill 将从执行命令的路径开始扫描node_modules。

2023年 7月 9日 0条评论 735点热度 0人点赞 周凯 阅读全文
spring-boot

ruoyi mybatis替换为mybatis-plus

在ruoyi-admin包中pom新增 mybatis-plus配置 <!--mybatis-plus--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.5.3.1</version> </dependency> 在applicatgion.…

2023年 7月 9日 0条评论 632点热度 0人点赞 周凯 阅读全文
react

nextjs export 静态页面时避免出现404

问题 当你写完多个页面,exoprt静态页面后,放在服务器上直接访问某个子页面**​**,发现直接访问给你返回了个404,你去查看目录结构,发现nextjs工具给你生成了register.html。而不是/register/index.html。自然会返回404 解决办法 官方文档也有提及 修改next.config.js 。添加 exportTrailingSlash: true module.exports = withLess({ exportTrailingSlash: true, // make /abo…

2023年 7月 7日 1条评论 1032点热度 0人点赞 周凯 阅读全文
工具

mac m2 pro Parallels Desktop成功安装windows11 Easy connect虚拟网卡拉取失败,设备管理器未安装上虚拟网卡

问题 拉起虚拟网卡失败,请确保虚拟网卡已经安装在系统上并处于启用状态,然后再重新登录 前提 已成功安装成功Parallels Desktop及windows11 解决 先卸载windows自动安装的easyconnect 访问深信服官网论坛 https://bbs.sangfor.com.cn/forum.php?mod=viewthread&tid=144275,下载对应的包重新安装 或者直接下载我下载好的文件,EasyConnectInstaller(M7.6.7及以上)

2023年 7月 4日 0条评论 843点热度 0人点赞 周凯 阅读全文
spring-boot

spring-boot-devtools idea不生效

pom配置插件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> idea设置

2023年 7月 1日 0条评论 540点热度 0人点赞 周凯 阅读全文
java

@Autowired自动注入map

前言 spring是支持基于接口实现类的直接注入的; 支持注入map,list等集合中,不用做其他的配置,直接注入; 为什么要用这种方式注入bean呢? 适用于一个接口有多个实现类,然后根据不同的参数选择执行不同的实现类,其实就是策略模式 Spring 会在启动时,自动查找实现了该接口的 bean,放到这个Map中去。key为bean的名字,value为 实现了该接口的所有的 bean。 注意:这里只有在map的key为string类型时才有效 @Autowired 标注作用于 Map 类型时,如果 Map 的 k…

2023年 6月 28日 0条评论 593点热度 0人点赞 周凯 阅读全文
工具

mac彻底删除EasyConnect

问题 使用mac EasyConnect 多个版本,直接删除之后,重新安装 发现还是另一个版本,无法删除干净。 删除EasyConnect.app $ sudo rm -rf ~/.Trash/EasyConnect.app 只需要执行这条命令就可以把app文件删掉。 删除EasyConnect安装时设置的自动启动项 上面的文章中有说开机自启守护进程配置在/Library/LaunchDaemons/这个目录,所以进入这个目录将所有以com.sangfor开头的plist文件都删除掉就行了。 删除EasyConne…

2023年 6月 26日 0条评论 1291点热度 1人点赞 周凯 阅读全文
vite

Vue2.7 + Vite + Eslint配置

在根目录下添加 .editorconfig 文件: # EditorConfig is awesome: https://EditorConfig.org # top-most EditorConfig file root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = false insert_final_newline = false 安装 es…

2023年 5月 29日 0条评论 1379点热度 0人点赞 周凯 阅读全文
1…89101112…20
搜索
分类
归档

COPYRIGHT © 2022-现在 周凯,个人博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蒙ICP备18004897号