1 2 3 4
摘要: 1.为什么使用hook 我们经常维护一些组件,组件起初很简单,但是逐渐会被状态逻辑和副作用充斥。每个生命周期常常包含一些不相关的逻辑。例如,组件常常在 componentDidMount 和 componentDidUpdate 中获取数据。但是,同一个 componentDidMount 中可能也 阅读全文
posted @ 2020-08-25 10:38 红鲤鱼与LV 阅读(588) 评论(0) 推荐(1) 编辑
摘要: 1.get方法(获取对象、数组值) 普通写法: log[0].value.name 使用lodash: get(log[0], 'value.name') 优点:当log[0]为null时,普通方法会报错,lodash方法会返回空,lodash更安全 get(log[0], 'value.name' 阅读全文
posted @ 2020-08-05 16:57 红鲤鱼与LV 阅读(721) 评论(0) 推荐(0) 编辑
摘要: moment(data).unix() 阅读全文
posted @ 2020-08-04 11:34 红鲤鱼与LV 阅读(9638) 评论(0) 推荐(0) 编辑
摘要: 首先我们要知道一个前提,路由传递的参数我们可以通过props里面的属性来获取。只要组件是被<Router>组件的<component>定义和指派的,这个组件自然就有了props的match,history和location属性。 了解了这个,接下来我们进入正题: 1.动态路由用法一:(:id法) 通 阅读全文
posted @ 2018-11-18 12:03 红鲤鱼与LV 阅读(7764) 评论(0) 推荐(1) 编辑
摘要: 1.vue中的指令有哪些? 2.语法: // 注册一个全局自定义指令,例如 `v-focus` Vue.directive('指令名字', 钩子) //注意:自定义指令名字不用加v-了。 钩子里传一个参数,在参数中做事情。一般用来操作DOM,否则没什么意义。 3.注册自定义指令分类全局注册和局部注册 阅读全文
posted @ 2018-11-15 10:36 红鲤鱼与LV 阅读(4545) 评论(0) 推荐(0) 编辑
摘要: 使用lodash的pickBy: let fieldsValue = { name:'', age:18} let values = pickBy({ ...fieldsValue, }) 阅读全文
posted @ 2020-10-29 16:53 红鲤鱼与LV 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 在做项目时我遇到了这样一个情景,要获取多个公司的公司信息,而获取公司信息需要传公司名称去调接口。 此时多个公司是以数组形式展示:let companies = ['公司A ','公司B ','公司C ','公司D ']。 开始我在promise.all里面做循环遍历,代码如下: const res 阅读全文
posted @ 2020-10-28 15:13 红鲤鱼与LV 阅读(4283) 评论(0) 推荐(1) 编辑
摘要: 阅读全文
posted @ 2020-09-04 10:49 红鲤鱼与LV 阅读(191) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/humin/p/7136479.html https://www.jianshu.com/u/07214066934f https://www.jianshu.com/p/19ae438e1a1chttp://www.ptbird.cn/comment 阅读全文
posted @ 2020-09-04 10:46 红鲤鱼与LV 阅读(150) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qq_44752117/article/details/107875482 阅读全文
posted @ 2020-08-14 17:23 红鲤鱼与LV 阅读(2276) 评论(0) 推荐(0) 编辑
摘要: 1.https://www.tiny.cloud/docs/demo/full-featured/还不错 2.http://typecho.org/很好用 http://www.keydatas.com/caiji/typecho-cms-caiji?bd_vid=80867131374377483 阅读全文
posted @ 2020-08-13 14:10 红鲤鱼与LV 阅读(247) 评论(0) 推荐(0) 编辑
摘要: cropperjs图片裁剪工具、NProgress进度条 阅读全文
posted @ 2020-08-13 11:40 红鲤鱼与LV 阅读(136) 评论(0) 推荐(0) 编辑