会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
jardeng
博客园
首页
新随笔
联系
订阅
管理
[置顶]
js实现树级递归,通过js生成tree树形菜单(递归算法)
摘要: 方法封装: /** * 数据转换为树形(递归),示例:toTreeByRecursion(source, 'id', 'parentId', null, 'children') * @param {Array} source 数据 * @param {String} idField 标识字段名称 *
阅读全文
posted @ 2020-08-21 16:28 jardeng
阅读(12524)
评论(0)
推荐(1)
[置顶]
antd-vue中table行高亮效果实现
摘要: 【方式一】:通过设置customRow达到目的,点击时遍历所有行设置为正常颜色,把当前行设置为特殊颜色(高亮色) HTML: <a-table ref="table" size="small" rowKey="id" bordered :columns="physicalSurveyColumns"
阅读全文
posted @ 2020-08-09 01:58 jardeng
阅读(8955)
评论(0)
推荐(1)
[置顶]
ASP.NET Core3.1使用IdentityServer4中间件系列随笔(一):搭建认证服务器
摘要: 配套源码:https://gitee.com/jardeng/IdentitySolution 1、创建ASP.NET Core Web应用程序,选择空模板。 去掉HTTPS 2、添加nuget包:IdentityServer4。 3、添加Config.cs文件作为IdentityServer配置文
阅读全文
posted @ 2020-04-25 17:46 jardeng
阅读(3673)
评论(11)
推荐(3)
[置顶]
ASP.NET Core 3.1 WebAPI的跨域问题
摘要: 1、nuget要加上 Microsoft.AspNetCore.Cors 中间件。 2、在Startup类里先定义一个全局变量。 private readonly string AllowSpecificOrigin = "AllowSpecificOrigin"; 3、在Startup的Confi
阅读全文
posted @ 2020-04-01 11:53 jardeng
阅读(1499)
评论(0)
推荐(0)
2021年9月10日
js/ts 获取通过子项数字组合能组合成的最优组合
摘要: 例如:有一组数字,[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],需要从这一组数字中寻找最优的数字组合,让数字组合的总和最接近但不超过这个某个值,比如14,且组合的数字数量尽量多。 > [4, 10]有2个数字,可构成等于14,最接近14的数字组合。 > [1, 2, 3, 4]有4
阅读全文
posted @ 2021-09-10 12:05 jardeng
阅读(321)
评论(0)
推荐(0)
2021年7月21日
js/ts 将数字按照指定的拆分次数进行拆分
摘要: 代码如下: /** * 将数字拆分为指定数量的子数字数组 * @param targetNumber 需要拆分的目标数字 * @param splitCount 拆分次数 * @returns 拆分后的子数字数组 */ private numberSplit(targetNumber: number
阅读全文
posted @ 2021-07-21 18:44 jardeng
阅读(900)
评论(0)
推荐(0)
2021年7月14日
js 实现对象深拷贝
摘要: /** * 深拷贝 * @param {*} obj 需拷贝的对象 * @returns 深拷贝后的对象 */ function copyObj (obj) { // 对于原始类型和常见的非值,直接返回原来值 if ([NaN, null].includes(obj)) return obj if
阅读全文
posted @ 2021-07-14 14:23 jardeng
阅读(158)
评论(0)
推荐(0)
2021年6月4日
ts 实现 Dictionary 字典
摘要: 非泛型版 namespace demo { /** * 字典类 * let dictionary = new Dictionary(); // new一个对象 * // 设置属性 * dictionary.Set('gandalf', 'gandalf@email.com'); * dictiona
阅读全文
posted @ 2021-06-04 14:51 jardeng
阅读(2586)
评论(0)
推荐(0)
2021年5月29日
谷歌浏览器连接手机实时调试
摘要: 参考博文:手机web前端调试页面的几种方式 hosts文件添加以下 #chrome-devtools61.91.161.217 chrome-devtools-frontend.appspot.com61.91.161.217 chrometophone.appspot.com
阅读全文
posted @ 2021-05-29 11:04 jardeng
阅读(291)
评论(0)
推荐(0)
2021年3月17日
uni-app页面通信,传递复杂数据
摘要: > 使用 uni.navigateTo 跳转B页面(指下方代码的 test.vue 页面),跳转完成后,会触发 navigateTo 的回调函数success,使用 res.eventChannel 向被打开的页面传送数据。 > 被打开的页面B页面(test.vue),也可以在页面任意处,使用代码
阅读全文
posted @ 2021-03-17 19:09 jardeng
阅读(2809)
评论(0)
推荐(0)
2020年12月11日
vue 实现在文本框光标处插入内容
摘要: 场景:封装一个组件 - 简易计算器,在文本框点击时显示计算器,点击计算器上的按钮即数字、运算符等,就将点击的按钮文本插入到文本框的光标处 计算器组件calculator.vue <template> <!-- 计算器 --> <div ref="calculator" class="calculat
阅读全文
posted @ 2020-12-11 08:28 jardeng
阅读(984)
评论(0)
推荐(0)
2020年11月27日
jquery-ui draggable中div拖动出现辅助线方便对齐,实现简单布局器
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>实现div拖拽
阅读全文
posted @ 2020-11-27 18:04 jardeng
阅读(721)
评论(0)
推荐(0)
【转】jquery-ui draggable中div拖动出现辅助线方便对齐(优化)
摘要: <html> <head> <link rel="stylesheet" href="./jquery-ui-1.12.1/jquery-ui.min.css" /> <title>实现div拖拽时出现辅助线,以方便和其它div很容易的对齐</title> </head> <body> <div c
阅读全文
posted @ 2020-11-27 17:56 jardeng
阅读(329)
评论(0)
推荐(0)
2020年11月25日
vue-cli3.0 修改 index.html title标签中出现的htmlWebpackPlugin.options.title
摘要: vue.config.js // vue.config.js const vueConfig = { chainWebpack: config => { config.plugin('html').tap(args => { args[0].title = '这里设置标题' return args
阅读全文
posted @ 2020-11-25 09:47 jardeng
阅读(1583)
评论(0)
推荐(0)
下一页
公告