bugdemon8023
码龄11年
  • 53,359
    被访问
  • 53
    原创
  • 749,932
    排名
  • 8
    粉丝
关注
提问 私信
  • 加入CSDN时间: 2011-07-28
博客简介:

smz8023的博客

查看详细资料
个人成就
  • 获得10次点赞
  • 内容获得16次评论
  • 获得31次收藏
创作历程
  • 1篇
    2021年
  • 13篇
    2020年
  • 40篇
    2019年
成就勋章
TA的专栏
  • node脚本
    1篇
  • express
    1篇
  • 数组
    2篇
  • 时间
    1篇
  • 其他
    38篇
  • 正则
    1篇
  • webpack
    5篇
  • antd
    1篇
  • React-Native
    1篇
兴趣领域 设置
  • 前端
    javascriptreact.jswebpack
  • 最近
  • 文章
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

vue国际化抽取脚本

node 脚本 抽取前端项目国际化提取的思路很简单:0.使用前需要在该目录下创建一个backupI8的文件夹1.递归所有文件2.读取文件,创建该路径文件夹,按行读取,当读取到某一行有汉字时就提取出来3.每当读取完一个文件时就会创建一个相对应的json文件4.代码如下:const path = require('path')const fs = require('fs')var iconv = require('iconv-lite'); // node执行路径const dirPat
原创
发布博客 2021.03.24 ·
104 阅读 ·
0 点赞 ·
0 评论

express 源码实现(一)

express 源码实现(一)1.首先说一下大概使用方式const express = require('express'); const app = express(); // 执行函数返回一个app 应用// 发起get 请求app.get('/', function(req, res) { // 结束 返回内容 res.end('home')})app.get('/about', function(req, res) { res.end('about')})//
原创
发布博客 2020.10.15 ·
89 阅读 ·
0 点赞 ·
0 评论

vscode nodemon打断点

1,修改package.json"scripts": { "debug": "nodemon server.js" }, 2,修改.vscode/launch.json{ "version": "0.2.0", "configurations": [ { "name": "随意", "type": "node", "request": "launch",
原创
发布博客 2020.10.14 ·
221 阅读 ·
0 点赞 ·
0 评论

remote: error: cannot lock ref ‘refs/heads/dev/mz/dev‘: ‘refs/heads/dev‘ exists; cannot create ‘refs

remote: error: cannot lock ref 'refs/heads/dev/mz/dev': 'refs/heads/dev' exists; cannot create 'refs/heads/dev/mz/dev'To http://xx.xx.xx.xx/xxxx/xx.git原因为:远程有一个分支为dev分支,然后本地新创建了一个分支为dev/mz/dev所以会有问题;解决:git branch -m feature/mz/dev修改分支名称即可!...
原创
发布博客 2020.10.09 ·
3723 阅读 ·
0 点赞 ·
0 评论

前端数据映射

前端数据映射—>平铺1.树形结构的映射const data = [{ id:1, name:'1', children:[ { id:2, name:'1-1', children:[ { id:3, name:"1-1-1" }, { id:4, name:"1-1-2", children:[ { i
原创
发布博客 2020.09.18 ·
1508 阅读 ·
0 点赞 ·
0 评论

Promise的实现原理(三)

Promise的实现原理(三)1.Promise 实现原理1.1 Promise 实现原理之链式调用1.1.1 基础用法const p =new Promise((resolve,reject)=>{ resolve('成功')//这里得成功会调用下一个.then里的res回调函数 reject('失败')//这里得失败会调用下一个.then里的err回调函数})const p1 = p.then(res=>{ return res // 这里return值会在下一个.then
原创
发布博客 2020.09.18 ·
84 阅读 ·
1 点赞 ·
0 评论

Promise的实现原理(二)

Promise的实现原理(二)1.在Promise的实现原理(一)中我们已经实现到同步的promiseclass Mypromise { // executor 执行者,也就是调用方传过来的函数,他是立即执行的 constructor(executor){ // executor又有两个回调函数,一个成功的函数resolve,一个失败的状态reject,首先定义这两个函数 // 使用者传回成功的value值 const resolve = (value)=>{ // 因为pr
原创
发布博客 2020.09.15 ·
108 阅读 ·
0 点赞 ·
0 评论

Promise的实现原理(一)

Promise的实现原理(一)1.先说一下用法,根据用法来一步步实现;1.1 简单使用// 传如一个函数,函数里有两个参数,resolve,reject new Promise((resolve,reject)=>{ // 成功就调用 resolve() })1.1.1 来实现我们自己的Mypromiseclass Mypromise { // executor 执行者,也就是调用方传过来的函数,他是立即执行的 constructor(executor){ // exe
原创
发布博客 2020.09.14 ·
581 阅读 ·
1 点赞 ·
0 评论

移动端适配

npm install lib-flexible --savenpm install postcss-pxtorem --save-dev或者:npm install postcss-px2rem --save-devpostcss-pxtorem会将px转换为rem,rem单位用于适配不同宽度的屏幕,根据<html>标签的font-size值来计算出结果,1rem=html标签的font-size值。引入lib-flexible在项目入口文件main.js 中引入lib-fl
原创
发布博客 2020.09.14 ·
79 阅读 ·
1 点赞 ·
0 评论

Aop 切片编程

AOP 切片编程需求:1.在不动原来封装好的函数下,增加业务代码例如:const render = function(){ xxxxxxx console.log('render);}const oldPrototype = new Function().prototype;render.prorotype__proto__ = oldPrototype;render.before = function(callback){ return ()=>{ callback()
原创
发布博客 2020.09.14 ·
46 阅读 ·
0 点赞 ·
0 评论

定位缩放位置不发生改变

当一个元素需要定位到另一个元素上时,缩放会导致定位偏移例如:图片缩放时,定位点将发生偏移;处理:1.得到底层图片最大尺寸(maxWidth)2.实时更新底层图片大小(updateWidth)3.动态定位:{left: ${(i.latitude(需要定位元素坐标) * updateWidth) / mapWidth}px,top:同上,得到最大高度与实时更新高度即可}...
原创
发布博客 2020.08.17 ·
958 阅读 ·
0 点赞 ·
0 评论

linux jenkins连接gitlab 报错128

1.查看linux 下用户~cat /etc/passwdroot@wordpress-virtual-machine:/# cat /etc/passwdroot:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologinbin:x:2:2:bin:/bin:/usr/sbin/nologinsys:x:3:3:sys:/dev:/usr/sbin/nologinsync:x:4:65534:sync:
原创
发布博客 2020.05.22 ·
361 阅读 ·
0 点赞 ·
0 评论

ES6对象多层解构

这里写自定义目录标题ES6 对象多次解构ES6 对象多次解构 const data = {res:'ceshi',a:{b:'b测试'}} 接收res另起别名为res1; 接受a,在对a进行解构, const {res:res1,a:{b:b1}} = data; console.log('res1',res1);...
原创
发布博客 2020.03.20 ·
1970 阅读 ·
0 点赞 ·
0 评论

scrollIntoView 滑动卡顿或scrollIntoView不生效问题

在实际生产中遇到scrollIntoView滑动卡顿现象; dom.scrollIntoView({ behavior: "smooth", block: "nearest", //"start",// | "center" | "end" | "nearest", // 默认 inline: "nearest" ...
原创
发布博客 2020.01.19 ·
4625 阅读 ·
0 点赞 ·
2 评论

compose函数第二步

我们要先计算a函数,依赖a函数返回的结果在计算b函数举例: let a = (x,y)=>x+y; let b = (m)=>m * m;第一种:let q1 =function compose(a,b){ return (x,y) => b(a(x,y))} 第二种: function q (...[first,...out])=>(...
原创
发布博客 2019.12.23 ·
97 阅读 ·
0 点赞 ·
0 评论

compose函数第一步传参结构

函数传参let a = 1;let b = 2;let c = 3;function test(...[first,...outer]){// 在这个函数中我想拿到第一个参数 console.log(first) //1 console.log(outer) //[2,3]}
原创
发布博客 2019.12.23 ·
155 阅读 ·
0 点赞 ·
0 评论

for循环自定义跳出某一层循环体

在使用for循环时,为了资源的消耗,我们可以指定for循环跳出某一层循环体,距离如下: out: for (let i = 0; i < 10; i++) { int: for (let j = 0; j < 10; j++) { console.log('i+j',i+j) if(i+j===2){ ...
原创
发布博客 2019.12.20 ·
494 阅读 ·
0 点赞 ·
0 评论

Echarts

markPoint: { data: [ { name:'某个坐标', yAxis:'2.2', xAxis:'04:30', value:'标记1' ...
原创
发布博客 2019.12.16 ·
43 阅读 ·
0 点赞 ·
0 评论

umi 写多个className 名

<div className={`${style.a} ${style.b}`}></div>
原创
发布博客 2019.12.16 ·
678 阅读 ·
0 点赞 ·
0 评论

在react中使用防抖以及节流函数

在react中使用防抖以及节流函数这里已防抖函数举例;debounce.jsexport debounce = (fn,wait=1000)=>{ let timer = 0; if(timer){ clearTimeout(timer) } return (...args)=>{ timer = setTimeOut(()=>{ fn.apply(th...
原创
发布博客 2019.12.06 ·
2554 阅读 ·
0 点赞 ·
0 评论
加载更多