react dva 相关

摘要: models 阅读全文
posted @ 2018-12-24 10:12 刘二鹏 阅读(324) 评论(0) 推荐(0)

react实现多项选择题

摘要: clickItems(item){//处理工种选择的函数 const { data, dataList } = this.state; if (data.includes(item.id)) { // 移除 this.setState({ data: data.filter((items) => { 阅读全文
posted @ 2018-12-21 11:24 刘二鹏 阅读(1495) 评论(0) 推荐(0)

react 实现列表选择,在此点击取消

摘要: handeSecondQuestionOptions(item){//处理第二题 console.log(item.id) if(!this.state.data.includes(item.id)){ console.log("没有包含当前的对象") this.state.data.push(it 阅读全文
posted @ 2018-12-19 14:25 刘二鹏 阅读(1197) 评论(0) 推荐(0)

处理分页 当前页>1时, 操作的最后一页的最后一条数据后,向前提前一页

摘要: * handleAgentJobs({ payload }, { call, put }) { const data = yield call(handleAgentJob, payload) if (data && data.code 200) { yield put({ type: 'handl 阅读全文
posted @ 2018-12-15 14:49 刘二鹏 阅读(1042) 评论(0) 推荐(0)

1.处理当前时间前后的日期范围 2.处理日期格式

摘要: Month(month) {//处理当前时间前后的日期范围 var time = new Date(); time.setDate(time.getDate());//获取Day天后的日期 var y = time.getFullYear(); var m; if (time.getMonth() 阅读全文
posted @ 2018-12-08 15:28 刘二鹏 阅读(281) 评论(0) 推荐(0)

react dva 连接数据

摘要: import React ,{ Component } from 'react';import { connect } from 'dva';import { browserHistory } from 'dva/router';import G2 from '@antv/g2';import st 阅读全文
posted @ 2018-12-07 10:26 刘二鹏 阅读(764) 评论(0) 推荐(0)

react实现拖拽

摘要: import React from 'react'export default class extends React.Component { constructor(props) { super(props); this.state = { translateX: 0, translateY: 0 阅读全文
posted @ 2018-11-29 20:56 刘二鹏 阅读(770) 评论(0) 推荐(0)

JS实现判断滚动条滚到页面底部并执行事件的方法

摘要: 需要了解三个dom元素,分别是:clientHeight、offsetHeight、scrollTop。 clientHeight:这个元素的高度,占用整个空间的高度,所以,如果一个div有滚动条,那个这个高度则是不包括滚动条没显示出来的下面部分的内容。而只是单纯的DIV的高度。 offsetHei 阅读全文
posted @ 2018-11-23 17:41 刘二鹏 阅读(553) 评论(0) 推荐(0)

获取地址中的参数 封装在params对象里面

摘要: var params={}; if (window.location.search && window.location.search.split('?') && window.location.search.split('?')[1]) { params = globalParseQueryStr 阅读全文
posted @ 2018-11-19 16:08 刘二鹏 阅读(855) 评论(0) 推荐(0)

git常用命令

摘要: mkdir XX:创建一个空目录 XX指目录名pwd:显示当前目录的路径git init:吧当前的目录变成可以管理的git仓库,生成隐藏的.git文件touch xx:新建xx文件文件git add xx:把xx文件添加到暂存区 git add -A:把所有更改添加到暂存区git commit -m 阅读全文
posted @ 2018-11-19 15:58 刘二鹏 阅读(185) 评论(0) 推荐(0)