Xiaosa's Blog

不如去码头整点薯条

使用umirequest(fetch)上传图片

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import QueryString from 'qs' import request from "umi-request"; const upload = ({params={name:'name'},imag...

正则

是否是合法的url 1 2 3 4 values.avatar = values.avatar.replace(/^https?:\/\/[^/]+/, ""); // 如果存在域名 去掉 const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:...

支持render方法与dom渲染的antdesign 表格导出实现

表格导出功能 支持render方法 支持DOM渲染 (初级) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ...

Wsl docker cannot connect daemon问题的解决

问题描述: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 解决方法: 使用管理员身份运行terminal 1 2 3 4 5 sudo usermod -aG docker $USER sudo cgroupfs-mount sudo ser...

拿到新电脑该做的事情

安装 homeBrew 安装brew 1 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" (如果网络不好 可以使用下面的脚本) 1 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/H...

Centos使用过程中的笔记

centOS 安装 git centOS 源里的git版本太老 所以需要手动添加别的源 安装源 yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm 安装git yum install git 更新git yum update git ...

小程序 textarea 穿透

小程序的textArea组件会在安卓上出现穿透问题 , 无法被覆盖 解决方法 : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <View className='text-area-content' onClick={() => this.setState({hiddenTextArea: false})}> ...

在react 中使用echarts动态更新数据

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import ReactEcharts from 'echarts-for-react'; class EchartsProjects extends Component { getOption = () => ({option}}...

手写js方法的源码

bind 基础版 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 if(Function.prototype.bind === undefined){ console.log('您的浏览器不支持bind方法! 开始使用手写bind功能!'); Function.prototype.bind = function(obj){ var...

常见排序算法的js实现

快速排序 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 function jsQuickSort(array) { if (array.length <= 1) { return array; } const pivotIndex = Math.floor(array.length / ...