会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
搬砖的苦行僧
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
下一页
2021年6月23日
js的几种常用排序方法
摘要: 1. 冒泡排序: 依次比较两个相邻的元素,如果前一个数比后一个数大时就交换位置,比较晚第一轮最后一个元素是最大的元素,所以就不需要在比较最后一个元素了 var arr = [1, 2, 5, 7, 9, 22, 40] for(var i=0; i<arr.length-1; i++){ for(v
阅读全文
posted @ 2021-06-23 11:06 搬砖的苦行僧
阅读(5752)
评论(0)
推荐(0)
2021年6月18日
git 在切分支的时候切不到那个分支,但是远程上有
摘要: 1. 先将代码切到master分支: git pull 2. git fetch --all // fetch所有分支 3. git branch -a // 此时如果没有,就git fetch 指定分支
阅读全文
posted @ 2021-06-18 17:29 搬砖的苦行僧
阅读(266)
评论(0)
推荐(0)
解决打包时Failed at the project@1.0.0 build script. project@1.0.0 build: `node build/build.js`报错
摘要: 1. npm install npm@latest 将npm 更新到最新的版本 2. 再npm run build
阅读全文
posted @ 2021-06-18 17:25 搬砖的苦行僧
阅读(13006)
评论(0)
推荐(0)
2021年6月15日
js判断两个数组,在第一个数组中但不存在于第二个数组中的值
摘要: 方法一: 通过 lodash 比较简单 安装:npm i --save lodash 引入:import * as _ from 'lodash' 使用: _.difference([1, 2, 3, 5], [3, 4, 5, 6]); // => [1, 2] 方法二: let a = [1,2
阅读全文
posted @ 2021-06-15 15:01 搬砖的苦行僧
阅读(1230)
评论(0)
推荐(0)
2021年6月10日
已经git commit 但是想撤销怎么办
摘要: 仅仅撤销了commit操作,但是仍保留你add的代码 git reset --soft HEAD^ HEAD^的意思是上一个版本,也可以写成HEAD~1 如果你进行了2次commit,想都撤回,可以使用HEAD~2 撤销commit并且撤销add,但是不删除你改动的代码 git reset --mi
阅读全文
posted @ 2021-06-10 10:44 搬砖的苦行僧
阅读(134)
评论(0)
推荐(0)
2021年6月3日
实现多维数组变成一维数组的方法
摘要: 方法一: let = [1,[2,3],[4,5,[6,7]]]; let result_str = arr.join(',').split(','); console.log(result_str) // [1,2,3,4,5,6,7] 方法二:使用数组的concat方法,以及apply conc
阅读全文
posted @ 2021-06-03 21:00 搬砖的苦行僧
阅读(772)
评论(0)
推荐(0)
防止移动端点击输入框页面放大
摘要: 在入口文件index.html中加入 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cov
阅读全文
posted @ 2021-06-03 11:37 搬砖的苦行僧
阅读(260)
评论(0)
推荐(0)
React 绑定事件的几种写法bind(this)
摘要: 1. 我们在 React class Component 绑定事件时,经常会通过 bind(this) 来绑定事件 class Home extends React.Component{ constructor( props ){ super( props ); } handleClick(even
阅读全文
posted @ 2021-06-03 11:21 搬砖的苦行僧
阅读(680)
评论(0)
推荐(0)
2021年6月1日
在vue中使用mockjs
摘要: 1. 安装 npm install mockjs 2. 在src的目录下新建一个文件mock.js import Mock from 'mockjs' // 引入mockjs let data = { 'users|5': [ { 'age|1-100': 100, //100以内随机整数 'bir
阅读全文
posted @ 2021-06-01 14:43 搬砖的苦行僧
阅读(361)
评论(0)
推荐(0)
2021年5月29日
在Html中使用echarts图表
摘要: 命令安装:npm install echarts --save 在index.html的<head></head>标签中引入echarts <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
阅读全文
posted @ 2021-05-29 10:22 搬砖的苦行僧
阅读(1804)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告