摘要: 一、定义 1.单一职责原则又称单一功能原则,面向对象五个基本原则(SOLID)之一。它规定一个类应该只有一个发生变化的原因。 2.单一职责原则的核心是解耦和增强内聚性。 二、案例 public class Single { public static void main(String[] args) 阅读全文
posted @ 2021-06-02 16:19 ki1616 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 一、设计模式常用的七大原则有:二十三中设计模式都脱离不开这些原则(规则) 1-单一职责原则(互不影响) 2-接口隔离原则(一个类对另一个类的依赖应该建立在最小的接口上) 3-依赖倒转(倒置)原则(高层不依赖低层,高层为接口和抽象类,低层为实体类) 4-里氏替换原则(子类可以扩展父类的功能,但不能改变 阅读全文
posted @ 2021-05-26 17:17 ki1616 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 一、页面跳转方式(详情见微信官方https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html) 1、wx.switchTab 只能跳转到tabBar页面,并关闭其他所有非 tabBar 页面。 2、wx.re 阅读全文
posted @ 2021-05-12 18:21 ki1616 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 一、原本有间隙 1.wxml <view class="picture" wx:for="{{product}}"> <image class="img" src="{{item}}" mode="widthFix"></image> </view> 2.wxss .img{ width: 100% 阅读全文
posted @ 2021-05-12 18:17 ki1616 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 一、概念(复杂度O(㏒₂n)) 二分查找也称折半查找(Binary Search),它是一种效率较高的查找方法,可以理解为一直对折。但是,折半查找要求线性表必须采用顺序存储结构(优点:随机存取表中元素、储存密度大。缺点:插入和删除操作需要移动元素。),而且表中元素按关键字有序排列。 二、要求 1.必 阅读全文
posted @ 2021-05-12 17:39 ki1616 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1、radio失效(添加红色的即可) layer.open({ type: 1, title: "<label style='font-weight:600;'>修改</label>", content: editDiv, area: ['600px', height],//只有一个[height] 阅读全文
posted @ 2021-05-12 17:08 ki1616 阅读(1041) 评论(0) 推荐(0) 编辑
摘要: 1、设置input的值 onkeyup="this.value = this.value.replace(/[^\d.]/g,'');" 2、设置input的type type = "number"; 阅读全文
posted @ 2021-05-11 15:13 ki1616 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1、效果图 2、wxml <view class="master"> <view class="home"> <view class="home1"> <view class="home2"> <image src="/image/home1.png" style="width:40px;heigh 阅读全文
posted @ 2021-05-10 16:38 ki1616 阅读(724) 评论(0) 推荐(0) 编辑
摘要: 1、.wxml(按钮的样式不生效,可删除app.json里的 "style": "v2" ) <button style="width:80%;" class='btn1' open-type='openSetting'> <image style="height: 40rpx;" class='b 阅读全文
posted @ 2021-05-10 15:10 ki1616 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 一、symbol 1.搭建环境(在项目根目录打开cmd窗口) npm init -y 这时根目录会多出一个package.json文件 2.mini-program-iconfont-cli(PS:一种适合小程序的多色解决方案) npm install mini-program-iconfont-c 阅读全文
posted @ 2021-05-05 16:37 ki1616 阅读(601) 评论(0) 推荐(0) 编辑