上一页 1 2 3 4 5 6 7 ··· 18 下一页
  2023年5月9日
摘要: 1 简介 提供一种方法顺序访问一个聚合对象中的各个元素,而又不需要暴露该对象的内部表示 jQuery 中的迭代器 $.each([1, 2, 3], (i, n) => { console.log('当前下标:' + i) console.log('当前值:' + n) }) 2 实现自己的迭代器 阅读全文
posted @ 2023-05-09 10:49 pleaseAnswer 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1 简介 为一个对象提供一个代用品或占位符,以便控制对它的访问 应用:明星都有经纪人作为代理 关键:当客户不方便直接访问一个对象或不满足需求时,提供一个替身对象来控制对这个对象的访问,实际上访问的是替身对象 2 例子 -- 小明追mm的故事 1. 不使用代理 class Flower {} let 阅读全文
posted @ 2023-05-09 10:48 pleaseAnswer 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1 简介 定义一系列的算法,把它们一个个封装起来,并且使它们可以相互替换 2 使用策略模式计算奖金 以年终奖的计算为例 公司的年终奖是根据员工的工资基数和年底绩效情况来发放的。你负责编写代码来给财务计算员工的年终奖 1. 代码实现 /** * caculateBonus 计算每个人的奖金数额 * @ 阅读全文
posted @ 2023-05-09 10:47 pleaseAnswer 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1 简介 保证一个类仅有一个实例,并提供一个访问它的全局访问点 线程池、全局缓存、浏览器中的window对象 2 实现单例模式 思路:用一个变量来标志当前是否已为某个类创建过对象,是则在下一次获取该类的实例时直接返回之前创建的对象 function Singleton(name) { this.na 阅读全文
posted @ 2023-05-09 10:47 pleaseAnswer 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 父组件调用子组件的方法 使用ref 使用变量+watch 使用中间class 使用中间class base-on-controller function receiveController(to, from) { Object.assign(to, from); } /* vue 混入模式 */ r 阅读全文
posted @ 2023-05-09 10:28 pleaseAnswer 阅读(54) 评论(0) 推荐(0) 编辑
  2023年4月25日
摘要: git merge 和 git merge --no-ff 的区别 fast-forward(默认) Git 合并两个分支时,如果顺着一个分支走下去可以到达另一个分支的话,那么 Git 在合并两者时,只会简单地把指针右移,叫做“快进”(fast-forward) 不过这种情况如果删除分支,则会丢失 阅读全文
posted @ 2023-04-25 14:45 pleaseAnswer 阅读(143) 评论(0) 推荐(0) 编辑
  2023年2月9日
摘要: 对话框类 1 构造者函数+基本功能 class ListDataCls { /** 公共字段... **/ constructor(props) { Object.assign(this, props) } closeModal() {} resetData() {} openEditHandle( 阅读全文
posted @ 2023-02-09 14:27 pleaseAnswer 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 表格类 1 构造者函数+基本功能 class ListDataCls { /** 公共字段... **/ constructor(config) { if (Reflect.has(config, 'isChart')) { this.isChart = false; // 是否有 chart th 阅读全文
posted @ 2023-02-09 14:26 pleaseAnswer 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 1 实现效果 2 单个查询框组件 根据接口返回的 conditions_configs 字段动态生成查询框 ConditionOne 2.1 模板 <template> <!-- 日期 --> <DatePicker2 v-if="data.type.includes('date')" v-mode 阅读全文
posted @ 2023-02-09 14:23 pleaseAnswer 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 1 实现效果 2 应用 2.1 父组件调用模板 <template> <Row> <Form label-position="right" :label-width="80"> <Col span="24" v-for="(conditionItem, key, index) in otherCon 阅读全文
posted @ 2023-02-09 14:14 pleaseAnswer 阅读(50) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 18 下一页