摘要: 记录es6新增的实用数组去重的方法: 1简单类型: //ES6中新增了Set数据结构,类似于数组,但是 它的成员都是唯一的 ,其构造函数可以接受一个数组作为参数,如: let array = [1, 1, 1, 1, 2, 3, 4, 4, 5, 3]; let set = new Set(arra 阅读全文
posted @ 2019-09-19 09:47 木易锅巴 阅读(748) 评论(0) 推荐(1) 编辑
摘要: 我在gittub新建了一个项目仓库practice,然后我在本地将写好的项目推送到该仓库中去,操作如下: 1git init 初始化,不然git无法跟踪 2 git add . git commit -m "first commit" 提交所有文件到暂存区 3git remote add origi 阅读全文
posted @ 2019-09-18 17:50 木易锅巴 阅读(12453) 评论(0) 推荐(0) 编辑
摘要: //获取滚动条当前的位置 function getScrollTop() { var scrollTop = 0; if (document.documentElement && document.documentElement.scrollTop) { scrollTop = document.d 阅读全文
posted @ 2019-09-17 16:39 木易锅巴 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 操作: (1):在接诊记录列表页有搜索条件如姓名手机号,接诊时间和接诊类型。 (2):输入搜索查询条件后,点击进去详情页。 (3):在详情页点击返回列表按钮。 要求: 在列表页还回显跳转详情页时的搜索条件,且刷新页面后搜索条件重置为初始状态。 页面展示: (1)列表页面初始状态。 (2):增加搜索条 阅读全文
posted @ 2019-09-09 16:52 木易锅巴 阅读(3558) 评论(0) 推荐(0) 编辑
摘要: 都知道typeof null的值是object,那么为什么typeof null 的值是object呢。 《你不知道的javascript》中写到: 原理是这样的,不同的对象在底层都表示为二进制,在javascript中要是二进制前三位都是0的话就表示对象,而null的二进制都是0,那么前三位自然也 阅读全文
posted @ 2019-09-02 11:51 木易锅巴 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 组件核心代码: import React from 'react'; // import PropTypes from 'prop-types'; // 展开收起组件 class ArrowSlide extends React.Component { static defaultProps = { 阅读全文
posted @ 2019-08-01 10:39 木易锅巴 阅读(4139) 评论(0) 推荐(0) 编辑
摘要: 组件核心代码: import React, { Component } from 'react' import PropTypes from 'prop-types'; // toast 弹框组件 class Toast extends Component { static defaultProps 阅读全文
posted @ 2019-07-31 17:57 木易锅巴 阅读(2322) 评论(0) 推荐(0) 编辑
摘要: 我们业务场景经常会有后台返回数据,然后从数据里面取属性值,es6有了默认值之后,可以直接数据取值,取不到或者没有直接返回的是默认值 抽空时间封装了一个取值的方法: /** * {}类型属性取值,属性嵌套取值,为空且不存在安全取值方法 * @param {obj} obj [要从取值的对象] * @p 阅读全文
posted @ 2019-05-17 11:53 木易锅巴 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 输入卡号:622848110110634315 输出卡号:6228 4811 0110 0634 315 思路:输入一个字符串,分隔成数组,循环数组,如果到第四位就加分隔符号,否则还是自己。下面封装成一个方法,可以每任意位数添加任意分隔符 /** * 字符串分割公共方法 * @param str s 阅读全文
posted @ 2019-05-16 14:12 木易锅巴 阅读(2046) 评论(2) 推荐(1) 编辑
摘要: 用clipboard.js实现文本复制 HTML render() { return ( <div> {/* 这边是要被复制的内容 */} <div ref={(el) => this.code = el}>{data.code}</div> {/* 复制按钮 */} <button ref={el 阅读全文
posted @ 2019-05-15 11:19 木易锅巴 阅读(1002) 评论(0) 推荐(0) 编辑