BFC 两栏布局
27 |28 | 左侧块浮动到左边,但是因为是浮动块,右侧块高度一旦超过左侧块后文字就会出现在左侧的下方,因为没有块把它挡住。 29 |
30 |31 | 解决办法: 32 | 让右侧块变为BFC文字就不会横过去。因为BFC元素不与Float元素相重叠。 33 |
34 |├── 新技术 ├── PWA.md ├── WebAssembly.md ├── ServiceWorker.md └── hybird.md ├── 5-性能优化 ├── testDemo │ ├── slowServer │ │ ├── slow.js │ │ ├── index.js │ │ ├── js-bottom.html │ │ └── js-header.html │ └── test-DOMContentLoaded.html ├── README.md ├── SEO.md ├── 性能测试.md ├── 雅虎军规.md ├── 编写高性能的Javascript.md ├── 浏览器渲染.md ├── 减少网络请求的次数或时间 │ └── CDN.md ├── 网络传输过程中优化.md └── 从输入URL到页面加载完成的过程.md ├── img ├── ==.png ├── fp.png ├── 666.jpg ├── TCP.png ├── UDP.png ├── brun.png ├── csrf.png ├── etag.png ├── fcp.png ├── fdjl.png ├── file.png ├── pipe.png ├── run.png ├── this.png ├── tls.png ├── vdon.png ├── ysbm.png ├── 流程图.jpg ├── QRcode.jpg ├── aduits.png ├── bdefine.png ├── cache.png ├── csr&ssr.png ├── define.png ├── domattr.png ├── domtree.png ├── dom事件模型.jpg ├── gc-new.png ├── http3.png ├── https.png ├── thank-1.png ├── thank-2.png ├── thank-3.png ├── thank-4.png ├── thank-5.jpg ├── thank-6.jpg ├── vScroll.png ├── webview.png ├── xuanran.png ├── yhjsf.png ├── 输入URL后.png ├── cache-200.png ├── cache-all.png ├── cdncache.png ├── debounce.png ├── example1.png ├── example2.png ├── function.png ├── git-glkz.png ├── git-jlcy.png ├── imgbottom.png ├── prototype.png ├── pureRedux.png ├── aduitsReport.png ├── cache-demo.png ├── cache-from.png ├── cache-github.png ├── cache-reopen.png ├── cache-worker.png ├── cdnnocahche.png ├── etag-match.png ├── fetch&pull.jpg ├── force-cache.png ├── git-3-place.png ├── git-commit.png ├── git-mergep.png ├── git-mergep2.png ├── git-rebease.png ├── http-3-base.webp ├── http-cache.png ├── http2-hpack.jpeg ├── http2-二进制传输.png ├── http2Connet.png ├── httpscrypt.png ├── lifeofframe.jpg ├── performance.png ├── quarticBye.png ├── slideWindow.png ├── stadardBox.png ├── strangeBox.png ├── addressChange.png ├── auditsSuggest.png ├── cache-refresh.png ├── consult-cache.png ├── git-newbranch.png ├── reload-worker.png ├── serviceWorker.png ├── setStateCercle.png ├── thr-handshake.png ├── 1729cf3b0a40a037.png ├── 1729d0dc24e12fcb.png ├── cache-consult-304.png ├── cache-lastmodify.png ├── consult-invalid.png ├── force-cache-use.png ├── git-headpointer.png ├── if-modified-since.png ├── istanbul-lanjie.png ├── performanceTime.png ├── marginSuperposition1.png ├── marginSuperposition2.png ├── marginSuperposition3.png └── marginSuperposition4.png ├── 实用工具与库 ├── 插件 │ ├── README.md │ └── 规范风格.md ├── decorateComponentWithProps.md ├── Formik │ └── README.md └── npm │ └── package-lock.json.md ├── 杂项 ├── 面试 │ ├── 简历.md │ ├── README.md │ └── 自我介绍.md ├── TODO.md ├── 前端资源汇总.md ├── 收到的感谢.md ├── 前端成长.md ├── 如何写技术文章(分享型).md ├── 优雅代码.md └── 前端二进制.md ├── 0-前端基础 ├── CSS │ ├── 动画 │ │ ├── animal.png │ │ ├── transition.html │ │ ├── animation.html │ │ ├── animal.html │ │ └── README.md │ ├── 布局 │ │ ├── Flex.md │ │ ├── BFC两栏布局.html │ │ ├── 三栏-网格布局.html │ │ ├── 三栏-flex.html │ │ ├── 三栏-浮动方案.html │ │ ├── 三栏-绝对定位.html │ │ ├── 三栏-表格布局.html │ │ ├── 双飞翼布局.html │ │ ├── 圣杯布局.html │ │ └── README.md │ ├── 居中元素 │ │ ├── 水平居中 │ │ │ ├── center1.html │ │ │ ├── center2.html │ │ │ ├── center4.html │ │ │ └── center3.html │ │ ├── 垂直居中 │ │ │ ├── center2.html │ │ │ ├── center3.html │ │ │ ├── center1.html │ │ │ ├── center4.html │ │ │ ├── center-in-body.html │ │ │ └── center5.html │ │ └── README.md │ └── CSS选择器.md ├── Web安全 │ ├── SQL注入.md │ ├── CSRF.md │ └── README.md ├── NodeJS │ ├── 异步IO.md │ ├── 核心模块 │ │ ├── process.md │ │ └── path.md │ ├── README.md │ └── npm.md ├── HTML │ └── example.html ├── JS │ ├── this.md │ ├── 事件.md │ ├── 3-运算符.md │ ├── 垃圾回收与内存泄露和优化.md │ ├── 其他题目.md │ ├── ServiceWorker.md │ ├── 作用域.md │ └── 事件队列.md └── 浏览器 │ └── 屏幕刷新率&帧.md ├── 1-前端框架与库 ├── React │ ├── 基础 │ │ ├── Hooks.md │ │ ├── 高阶组件.md │ │ ├── memo.md │ │ ├── PureComponent与Component区别.md │ │ ├── lazy与suspense.md │ │ ├── VDOM.md │ │ └── context.md │ ├── react-router.md │ ├── React中性能优化.md │ ├── Hooks │ │ ├── 其他 hooks.md │ │ ├── 组件复用例子 │ │ │ ├── hooks.jsx │ │ │ ├── class.jsx │ │ │ ├── render-props.jsx │ │ │ └── HOC.jsx │ │ ├── 自定义 hooks.md │ │ ├── README.md │ │ └── hooks 与定时器.md │ ├── React与Vue区别.md │ ├── react-script.md │ ├── Redux.md │ ├── 其他.md │ └── setState.md ├── Webpack │ ├── README.md │ ├── 基本概念 │ │ ├── plugins.md │ │ ├── 安装.md │ │ └── entry 和 output.md │ ├── 高级概念 │ │ ├── sourcemap.md │ │ └── 缓存.md │ └── webpack配置文件.md └── TypeScript │ ├── interface与type.md │ ├── 实用技巧.md │ ├── 接口.md │ └── 装饰器.md ├── 3-编程能力 ├── 函数式编程 │ └── README.md ├── 编程题与分析题 │ ├── 作用域.md │ ├── README.md │ ├── reduce实现map.md │ ├── reduce案例.js │ ├── 实现flatten函数.md │ ├── 两任务并行.md │ ├── name的值是多少.md │ ├── 手写Promise.md │ ├── 尽早按序打印Ajax请求.js │ ├── compose.md │ ├── 柯里化.md │ ├── debounce-demo.js │ ├── bind、apply实现.md │ ├── 类型判断.md │ ├── 实现一个sleep函数.md │ ├── 闭包.md │ ├── this指向.md │ ├── PromiseAll.md │ ├── 防抖节流.md │ ├── 使用Promise封装一个AJAX.md │ ├── deepCopy.js │ ├── 以下代码输出值.md │ └── 异步编程.md └── 算法 │ └── 树的遍历 │ ├── 广度优先遍历.js │ └── 深度优先遍历.js ├── 2-计算机基础 ├── 网络 │ ├── fetch.md │ ├── nginx.md │ ├── UDP.md │ ├── CDN.md │ ├── README.md │ ├── cookie和session.md │ ├── RESTful.md │ ├── Ajax.md │ ├── HTTPS.md │ └── 跨域.md └── 操作系统 │ ├── README.md │ ├── 进程与线程.md │ └── 死锁与银行家算法.md ├── .gitignore ├── 知识模型.md ├── 4-质量保障 └── 监控 │ ├── 错误监控.md │ └── README.md ├── package.json ├── 6-工程架构 ├── ServerLess.md └── BFF.md ├── LICENSE └── README.md /新技术/PWA.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /新技术/WebAssembly.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /新技术/ServiceWorker.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /5-性能优化/testDemo/slowServer/slow.js: -------------------------------------------------------------------------------- 1 | alert("我现在才被加载出来"); 2 | -------------------------------------------------------------------------------- /img/==.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/==.png -------------------------------------------------------------------------------- /img/fp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/fp.png -------------------------------------------------------------------------------- /实用工具与库/插件/README.md: -------------------------------------------------------------------------------- 1 | # 工具插件 2 | 3 | ### TabNine 4 | 5 | 一个机器学习驱动的代码自动补全工具 6 | -------------------------------------------------------------------------------- /img/666.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/666.jpg -------------------------------------------------------------------------------- /img/TCP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/TCP.png -------------------------------------------------------------------------------- /img/UDP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/UDP.png -------------------------------------------------------------------------------- /img/brun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/brun.png -------------------------------------------------------------------------------- /img/csrf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/csrf.png -------------------------------------------------------------------------------- /img/etag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/etag.png -------------------------------------------------------------------------------- /img/fcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/fcp.png -------------------------------------------------------------------------------- /img/fdjl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/fdjl.png -------------------------------------------------------------------------------- /img/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/file.png -------------------------------------------------------------------------------- /img/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/pipe.png -------------------------------------------------------------------------------- /img/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/run.png -------------------------------------------------------------------------------- /img/this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/this.png -------------------------------------------------------------------------------- /img/tls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/tls.png -------------------------------------------------------------------------------- /img/vdon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/vdon.png -------------------------------------------------------------------------------- /img/ysbm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/ysbm.png -------------------------------------------------------------------------------- /img/流程图.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/流程图.jpg -------------------------------------------------------------------------------- /img/QRcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/QRcode.jpg -------------------------------------------------------------------------------- /img/aduits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/aduits.png -------------------------------------------------------------------------------- /img/bdefine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/bdefine.png -------------------------------------------------------------------------------- /img/cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache.png -------------------------------------------------------------------------------- /img/csr&ssr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/csr&ssr.png -------------------------------------------------------------------------------- /img/define.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/define.png -------------------------------------------------------------------------------- /img/domattr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/domattr.png -------------------------------------------------------------------------------- /img/domtree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/domtree.png -------------------------------------------------------------------------------- /img/dom事件模型.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/dom事件模型.jpg -------------------------------------------------------------------------------- /img/gc-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/gc-new.png -------------------------------------------------------------------------------- /img/http3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http3.png -------------------------------------------------------------------------------- /img/https.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/https.png -------------------------------------------------------------------------------- /img/thank-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-1.png -------------------------------------------------------------------------------- /img/thank-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-2.png -------------------------------------------------------------------------------- /img/thank-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-3.png -------------------------------------------------------------------------------- /img/thank-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-4.png -------------------------------------------------------------------------------- /img/thank-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-5.jpg -------------------------------------------------------------------------------- /img/thank-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thank-6.jpg -------------------------------------------------------------------------------- /img/vScroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/vScroll.png -------------------------------------------------------------------------------- /img/webview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/webview.png -------------------------------------------------------------------------------- /img/xuanran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/xuanran.png -------------------------------------------------------------------------------- /img/yhjsf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/yhjsf.png -------------------------------------------------------------------------------- /img/输入URL后.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/输入URL后.png -------------------------------------------------------------------------------- /img/cache-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-200.png -------------------------------------------------------------------------------- /img/cache-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-all.png -------------------------------------------------------------------------------- /img/cdncache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cdncache.png -------------------------------------------------------------------------------- /img/debounce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/debounce.png -------------------------------------------------------------------------------- /img/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/example1.png -------------------------------------------------------------------------------- /img/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/example2.png -------------------------------------------------------------------------------- /img/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/function.png -------------------------------------------------------------------------------- /img/git-glkz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-glkz.png -------------------------------------------------------------------------------- /img/git-jlcy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-jlcy.png -------------------------------------------------------------------------------- /img/imgbottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/imgbottom.png -------------------------------------------------------------------------------- /img/prototype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/prototype.png -------------------------------------------------------------------------------- /img/pureRedux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/pureRedux.png -------------------------------------------------------------------------------- /杂项/面试/简历.md: -------------------------------------------------------------------------------- 1 | # 如何写好的技术简历? 2 | 3 | - [是时候更新一下你的简历了](https://zhuanlan.zhihu.com/p/89522100) 4 | -------------------------------------------------------------------------------- /img/aduitsReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/aduitsReport.png -------------------------------------------------------------------------------- /img/cache-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-demo.png -------------------------------------------------------------------------------- /img/cache-from.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-from.png -------------------------------------------------------------------------------- /img/cache-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-github.png -------------------------------------------------------------------------------- /img/cache-reopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-reopen.png -------------------------------------------------------------------------------- /img/cache-worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-worker.png -------------------------------------------------------------------------------- /img/cdnnocahche.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cdnnocahche.png -------------------------------------------------------------------------------- /img/etag-match.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/etag-match.png -------------------------------------------------------------------------------- /img/fetch&pull.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/fetch&pull.jpg -------------------------------------------------------------------------------- /img/force-cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/force-cache.png -------------------------------------------------------------------------------- /img/git-3-place.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-3-place.png -------------------------------------------------------------------------------- /img/git-commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-commit.png -------------------------------------------------------------------------------- /img/git-mergep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-mergep.png -------------------------------------------------------------------------------- /img/git-mergep2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-mergep2.png -------------------------------------------------------------------------------- /img/git-rebease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-rebease.png -------------------------------------------------------------------------------- /img/http-3-base.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http-3-base.webp -------------------------------------------------------------------------------- /img/http-cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http-cache.png -------------------------------------------------------------------------------- /img/http2-hpack.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http2-hpack.jpeg -------------------------------------------------------------------------------- /img/http2-二进制传输.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http2-二进制传输.png -------------------------------------------------------------------------------- /img/http2Connet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/http2Connet.png -------------------------------------------------------------------------------- /img/httpscrypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/httpscrypt.png -------------------------------------------------------------------------------- /img/lifeofframe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/lifeofframe.jpg -------------------------------------------------------------------------------- /img/performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/performance.png -------------------------------------------------------------------------------- /img/quarticBye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/quarticBye.png -------------------------------------------------------------------------------- /img/slideWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/slideWindow.png -------------------------------------------------------------------------------- /img/stadardBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/stadardBox.png -------------------------------------------------------------------------------- /img/strangeBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/strangeBox.png -------------------------------------------------------------------------------- /img/addressChange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/addressChange.png -------------------------------------------------------------------------------- /img/auditsSuggest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/auditsSuggest.png -------------------------------------------------------------------------------- /img/cache-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-refresh.png -------------------------------------------------------------------------------- /img/consult-cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/consult-cache.png -------------------------------------------------------------------------------- /img/git-newbranch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-newbranch.png -------------------------------------------------------------------------------- /img/reload-worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/reload-worker.png -------------------------------------------------------------------------------- /img/serviceWorker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/serviceWorker.png -------------------------------------------------------------------------------- /img/setStateCercle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/setStateCercle.png -------------------------------------------------------------------------------- /img/thr-handshake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/thr-handshake.png -------------------------------------------------------------------------------- /0-前端基础/CSS/动画/animal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/0-前端基础/CSS/动画/animal.png -------------------------------------------------------------------------------- /1-前端框架与库/React/基础/Hooks.md: -------------------------------------------------------------------------------- 1 | # hooks 2 | 3 | ### 类组件的缺点 4 | 5 | - 难以复用的状态逻辑 6 | - 复杂的生命周期函数 7 | - 混乱的副作用 8 | -------------------------------------------------------------------------------- /img/1729cf3b0a40a037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/1729cf3b0a40a037.png -------------------------------------------------------------------------------- /img/1729d0dc24e12fcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/1729d0dc24e12fcb.png -------------------------------------------------------------------------------- /img/cache-consult-304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-consult-304.png -------------------------------------------------------------------------------- /img/cache-lastmodify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/cache-lastmodify.png -------------------------------------------------------------------------------- /img/consult-invalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/consult-invalid.png -------------------------------------------------------------------------------- /img/force-cache-use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/force-cache-use.png -------------------------------------------------------------------------------- /img/git-headpointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/git-headpointer.png -------------------------------------------------------------------------------- /img/if-modified-since.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/if-modified-since.png -------------------------------------------------------------------------------- /img/istanbul-lanjie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/istanbul-lanjie.png -------------------------------------------------------------------------------- /img/performanceTime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/performanceTime.png -------------------------------------------------------------------------------- /实用工具与库/插件/规范风格.md: -------------------------------------------------------------------------------- 1 | # 规范与风格 2 | 3 | ### Eslint 4 | 5 | ### Pretter 6 | 7 | ### git-cz 8 | 9 | ### 10 | -------------------------------------------------------------------------------- /img/marginSuperposition1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/marginSuperposition1.png -------------------------------------------------------------------------------- /img/marginSuperposition2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/marginSuperposition2.png -------------------------------------------------------------------------------- /img/marginSuperposition3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/marginSuperposition3.png -------------------------------------------------------------------------------- /img/marginSuperposition4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huyaocode/webKnowledge/HEAD/img/marginSuperposition4.png -------------------------------------------------------------------------------- /杂项/TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 清单 2 | 3 | - [对标阿里 p6 自检](https://mp.weixin.qq.com/s/0Y456nHryt03kmaC8tBXTw) 4 | - 按照自检清单梳理并学习 5 | -------------------------------------------------------------------------------- /3-编程能力/函数式编程/README.md: -------------------------------------------------------------------------------- 1 | # 函数式编程 2 | 3 | https://juejin.im/post/6844903936378273799#heading-31 4 | https://juejin.im/post/6844904034260910094 5 | -------------------------------------------------------------------------------- /1-前端框架与库/Webpack/README.md: -------------------------------------------------------------------------------- 1 | ### webpack 简介 2 | 3 | `webpack`是一个前端模块化打包工具,最开始它只能打包 JS 文件,但是随着 webpack 的发展,他还能打包如 CSS、图片等文件。主要由入口,出口,loader,plugins 四个部分。 4 | -------------------------------------------------------------------------------- /2-计算机基础/网络/fetch.md: -------------------------------------------------------------------------------- 1 | # fetch 2 | 3 | ## fetch 的缺点 4 | 5 | - 只对网络请求报错,对 400,500 都当做成功的请求 6 | - 默认不会带 cookie 7 | - 不支持 abort, 不支持超时控制 8 | - 没办法原生监控请求进度 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | .nyc_output 4 | .DS_Store 5 | *.log 6 | .vscode 7 | .idea 8 | compiled 9 | .awcache 10 | .rpt2_cache 11 | .pdf 12 | 0练手 13 | test.js -------------------------------------------------------------------------------- /1-前端框架与库/React/react-router.md: -------------------------------------------------------------------------------- 1 | # 路由 2 | 3 | React 中路由主要有两种方式: 4 | 5 | - hash 路由 6 | - history 路由 7 | 8 | [react-router 原理](https://blog.csdn.net/qq_36223144/article/details/83247008) 9 | -------------------------------------------------------------------------------- /0-前端基础/Web安全/SQL注入.md: -------------------------------------------------------------------------------- 1 | # SQL 注入 2 | 3 | 所谓 SQL 注入,就是通过把 SQL 命令插入到 Web 表单提交或输入域名或页面请求的查询字符串,后台执行 SQL 语句时直接把前端传入的字段拿来做 SQL 查询。 4 | 5 | ## 防御 6 | 7 | - 永远不要信任用户的输入。 8 | - 永远不要使用动态拼装 sql 9 | - 不要把机密信息直接存放 10 | -------------------------------------------------------------------------------- /杂项/前端资源汇总.md: -------------------------------------------------------------------------------- 1 | - [GitHub 最全前端资源汇总](http://fenghub.top/front-end-index/index.html) 2 | - [前端进阶之道](https://yuchengkai.cn/) 3 | - [有关 React,你需要知道的一切](https://github.com/hateonion/react-bits-CN) 4 | - [木易杨-壹题](https://muyiy.cn/question/) 5 | -------------------------------------------------------------------------------- /3-编程能力/编程题与分析题/作用域.md: -------------------------------------------------------------------------------- 1 | ```js 2 | function func() { 3 | function a() { 4 | console.log(b); 5 | } 6 | 7 | a(); 8 | const b = "bbb"; 9 | } 10 | 11 | func(); 12 | ``` 13 | 14 | 上面代码会输出什么? 15 | 16 | 答案: 17 | 18 | > ReferenceError: Cannot access 'b' before initialization 19 | -------------------------------------------------------------------------------- /杂项/收到的感谢.md: -------------------------------------------------------------------------------- 1 | ## 收的到感谢 2 | 3 | 满足我的虚荣心,然后也让大家相信文档质量,相信努力会换来收获,我今后把收到的感谢都匿名整理在这里。之前还有好多感谢我都把聊天记录删了,可惜了,我的虚荣心啊~ 4 | 5 |  6 | 7 |  8 | 9 |  10 | 11 |  12 | 13 |  14 | 15 |  16 | -------------------------------------------------------------------------------- /1-前端框架与库/React/React中性能优化.md: -------------------------------------------------------------------------------- 1 | [React 性能优化](https://segmentfault.com/a/1190000006254212) 2 | 3 | [React 进阶—性能优化](https://segmentfault.com/a/1190000008925295) 4 | 5 | ### 为什么使用 Virtual DOM,直接操作 DOM 的弊端是什么? 6 | 7 | 操作 DOM 是非常昂贵的,因为一个普通的 DOM 上有非常多的属性和方法,页面的性能问题很多都是由 DOM 操作引起的。 8 | 9 | VDOM 的意义在于实现了对 DOM 的抽象,从而配合 Diff 算法来比对新旧状态切换时页面需要更新的最小 DOM 范围。 10 | -------------------------------------------------------------------------------- /0-前端基础/NodeJS/异步IO.md: -------------------------------------------------------------------------------- 1 | # 异步 I/O 2 | 3 | ## 为什么要异步 I/O 4 | 5 | ### 用户体验,快! 6 | 7 | 使用阻塞式加载两个资源时间为 M + N 8 | 9 | 使用异步 I/O 加载两个资源时间为: max(M, N) 10 | 11 | ### 资源分配 12 | 13 | 假设有一堆不相关的任务需要完成,主流有两种 14 | 15 | - 单线程串行依次执行 16 | - 多线程并行执行 17 | 18 | 多线程的代价在于创建线程和执行线程上下文切换的开销较大。在复杂业务中,多线程编程经常面临锁、状态同步等问题,这是多线程的主要诟病。 19 | 20 | 单线程顺序执行比较符合思考顺序,而且易于表达。但串行执行 21 | -------------------------------------------------------------------------------- /3-编程能力/编程题与分析题/README.md: -------------------------------------------------------------------------------- 1 | # 编程题与分析题 2 | 3 | 链接可能不够完整,直接看对应目录 4 | 5 | - [bind、apply 实现](bind、apply实现.md) 6 | - [DOM 树遍历](DOM树遍历.md) 7 | - [README](README.MD) 8 | - [this 指向](this指向.md) 9 | - [异步编程](异步编程.md) 10 | - [深浅拷贝](深浅拷贝.md) 11 | - [类型判断](类型判断.md) 12 | - [观察者模式](观察者模式.md) 13 | - [闭包](闭包.md) 14 | - [防抖节流](防抖节流.md) 15 | - [手写 Promise](手写Promise.md) 16 | -------------------------------------------------------------------------------- /5-性能优化/README.md: -------------------------------------------------------------------------------- 1 | ## 性能优化 2 | 3 | Web 端的性能一般包含两个方面:1.首屏快不快,2. 使用卡不卡。但是不能仅凭感觉,所以会有一些列的[性能指标](./性能指标与计算.md)。 4 | 5 | ### 首屏速度 6 | 7 | 首屏速度可以从「从输入 URL 到页面加载完成」这个过程入手: 8 | 9 | - 通过懒加载、资源压缩等的方式**减少首屏资源的大小** 10 | - 通过预拉取、BFF、模版注入等方式**减少网络请求的次数或时间** 11 | - 通过缓存、CDN、开启Gzip等方式,**在网络传输过程中进行优化** 12 | - 通过 SSR 提前渲染好 HTML,减少首屏UI网络请求次数和渲染耗时 13 | - 最后当资源加载好后,以最快的速度将页面渲染出来 14 | 15 | -------------------------------------------------------------------------------- /1-前端框架与库/React/Hooks/其他 hooks.md: -------------------------------------------------------------------------------- 1 | # 其他 hooks 2 | 3 | ## useLayoutEffect 4 | 5 | useLayoutEffect 的函数签名与 useEffect 相同,但是它会在所有的 DOM 变更之后**同步**调用 effect。在浏览器执行绘制之前,useLayoutEffect 内部的更新计划将被同步刷新。 6 | 7 | useLayoutEffect 相比 useEffect,通过同步执行状态更新可解决一些特性场景下的页面闪烁问题。 8 | 9 | useEffect 可以满足百分之 99 的场景,而且 useLayoutEffect 会阻塞渲染,请谨慎使用。 10 | 11 | 演示例子: https://juejin.im/post/6844904008402862094 12 | -------------------------------------------------------------------------------- /0-前端基础/HTML/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |28 | 左侧块浮动到左边,但是因为是浮动块,右侧块高度一旦超过左侧块后文字就会出现在左侧的下方,因为没有块把它挡住。 29 |
30 |31 | 解决办法: 32 | 让右侧块变为BFC文字就不会横过去。因为BFC元素不与Float元素相重叠。 33 |
34 |
6 |
7 | ### 有什么用?
8 |
9 | 作为**适配层**、**API聚合层**。
10 |
11 | **适配层**
12 |
13 | 如果我们的接口同时提供给`web`、`移动端`使用,`移动端`仅用来采集数据以及数据的展示,而`web`端大多数场景是用来管理数据,因为不同端点的业务有所不同,所以每一个端的接口复用度不会太高。
14 |
15 | 例子:比如PC端页面设计的API需要支持移动端,发现现有接口从设计到实现都与桌面UI展示需求强相关,无法简单适应移动端的展示需求 ,就好比PC端一个新闻推荐接口,接口字段PC端都需要,而移动端呢H5不需要,这个时候根据不同终端在BFF层做调整,同时也可以进行不同的(或更少的)API调用(聚合)来减少http请求。
16 |
17 | **API聚合层**
18 |
19 | 后端同学追求解藕,因为后端可能不止一个服务,但多个服务之间有时只是有简单的业务上关系,如果能引入BFF这中间层,就使得两边可以独立变化。
20 |
21 | 例子1:用户上传头像后,用户信息的头像信息要更新,用户的头像图片需要存。如果存图片是单独一个服务,头像信息又是另一个服务,通过 BFF 就可以解决。
22 |
23 | 例子2:比如一个用户进入页面时往往都会拉很多数据,比如他会先打请求拉自己的用户信息,再打请求拉用户的一些配置,然后页面再渲染,这样页面的首屏时间就变得缓慢。而如果引入BFF这中间层,让 BFF 层把该拿的数据合并为一个请求就返回回来,那么首屏速度就会加快。
24 |
25 | ### BFF的痛点
26 |
27 | - 维护问题:需要维护各种 BFF 应用。以往前端也不需要关心并发,现在并发压力却集中到了 BFF 上
28 | - 链路复杂:流程变得繁琐,BFF引入后,要同时走前端、服务端的研发流程,多端发布、互相依赖,导致流程繁琐
29 |
30 | ### 有什么方案可以解决传统BFF痛点?
31 |
32 | - 包括解决前端需要关心应用的负载均衡、备份冗灾、监控报警等一些列运维部署的操作
33 | - 如何统一管理和运维,提高发布速度、降低运维成本
34 |
35 | 答案是:`Serverless`
--------------------------------------------------------------------------------
/1-前端框架与库/React/基础/lazy与suspense.md:
--------------------------------------------------------------------------------
1 | # Lazy 与 Suspense
2 |
3 | ## lazy
4 |
5 | React.lazy 接受一个函数,这个函数需要动态调用 import()。它必须返回一个 Promise,该 Promise 需要 resolve 一个 defalut export 的 React 组件。
6 |
7 | ```js
8 | const OtherComponent = React.lazy(() => import("./OtherComponent"));
9 | ```
10 |
11 | lazy 函数用来将组件模块的导入行为封装为 React 组件。封装的是组件导入行为,而不是组件本身。而且导入意味着网络请求。
12 |
13 | ## Suspense
14 |
15 | lazy 必须配合 Suspense 来一起使用,因为在异步加载的过程中,这个空白档必须要给 React 提供一个 loading 的组件
16 | 注意:
17 |
18 | - Suspense 的 fallback 属性必须传入一个 React 实例,即一个 JSX
19 |
20 | ## ErrorBoundary
21 |
22 | 当 React 的异步组件加载出错时,页面就会报错。它利用了`componentDidCatch`这个生命周期函数来。
23 |
24 | ## 例子
25 |
26 | ```jsx
27 | const About = lazy(
28 | () =>
29 | new Promise((resolve, reject) => {
30 | setTimeout(() => {
31 | resolve(import(/* webpackChunkName:"about" */ "./About.jsx"));
32 | }, 2000);
33 | })
34 | );
35 |
36 | class App extends Component {
37 | render() {
38 | return (
39 | 父元素display: table;并且宽度为100%
37 |每一个子元素display: table-cell;
38 |左右两侧添加宽度,中间不加宽度
39 |包裹这个3个块的父元素display: flex; 中间的元素flex: 1;
41 |方法:left和right写在center前面,并且分别左右浮动;
40 |41 | 中间的这个div因为是块级元素,所以在水平方向上按照他的包容块自动撑开。 42 |
43 |简单,但是中心部分过长下面会溢出,然后文字就会跑到两边去。
44 |左右区域分别postion:absolute,固定到左右两边
40 |中间区域postion:absolute;left:300px; right: 300px
41 |给总的宽度加一个min-width,不然缩小窗口会有毛病
42 |父元素display: table;并且宽度为100%
42 |每一个子元素display: table-cell;
43 |左右两侧添加宽度,中间不加宽度
44 |