03 2021 档案
摘要:利用node实现一个简单服务器 const http = require('http') const urlModule = require('url') const server = http.createServer() server.on('request', function (req, r
阅读全文
摘要:这两个的区别常常容易忘记,做下笔记: 1.display:none会引起回流,而visibility:hidden不会引起回流 2.display:none不会在页面上显示,不会占据页面布局,但是存在html中,visibility:hidden会在页面显示,只不过看不到,也不可操作,也存在于htm
阅读全文
摘要:箭头函数和setTimeout的this指向问题 箭头函数的this指向window function指向本对象 let obj={ a:()=>{ console.log(this) }, b:function(){ console.log(this); } } obj.a() obj.b() s
阅读全文
摘要:v-html 有xss风险 computed有缓存,data不变就不会重新变化 watch如何深度监听 watch正常监听不到引用值对象属性的变化,需要在watch开启deep实现深度监听 data(){ return{ styleData:{ fontSize:'40px', 这里使用驼峰写法 b
阅读全文
摘要:1.尽可能避免在块内声明函数 foo(); // "b" var a = true; if (a) { function foo() { console.log("a"); } } else { function foo() { console.log("b"); } } 2.函数提升优于变量提升,
阅读全文
摘要:const { resolve } = require("path") const MiniCssExtractPlugin = require('mini-css-extract-plugin')//分离css文件 const OptimizeCssAssetsWebpackPlugin = re
阅读全文
摘要:冒泡排序: Array.prototype.bubbleSort = function () { for (let i = 0; i < this.length - 1; i += 1) { for (let j = 0; j < this.length - 1 - i; j += 1) { if
阅读全文
摘要:{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https:
阅读全文
摘要:<template> <div id="app"> <el-form :inline="true" :model="data" :rules="rules" class="demo-form-inline" ref="form" > <el-form-item label="审批人" prop="u
阅读全文
摘要:class jQuery { constructor(selector) { const result = document.querySelectorAll(selector) const length = result.length for (let i = 0; i < length; i++
阅读全文
摘要:/** * 深拷贝 */ const obj1 = { age: 20, name: 'xxx', address: { city: 'beijing' }, arr: ['a', 'b', 'c'] } const obj2 = deepClone(obj1) obj2.address.city
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:圣杯布局 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" conten
阅读全文
摘要:一. overflow:hidden 溢出隐藏 二. overflow:hidden 清除浮动 三. overflow:hidden 解决外边距塌陷 参考来源:overflow:hidden使用(溢出隐藏、清除浮动、解决外边距塌陷等等)
阅读全文
摘要://下面的地标需按照自己的需求添加 var geoCoordMap = { "广州":[113.23,23.16], "北京":[116.46,39.92], "呼和浩特":[111.65,40.82], "宁波":[121.56,29.86] }; var convertData = functi
阅读全文
摘要:定时器 addeventlisten
阅读全文
摘要:1、防抖(debounce):触发高频事件后 n 秒内函数只会执行一次,如果 n 秒内高频事件再次被触发,则重新计算时间 举例:就好像在百度搜索时,每次输入之后都有联想词弹出,这个控制联想词的方法就不可能是输入框内容一改变就触发的,他一定是当你结束输入一段时间之后才会触发。 节流(thorttle)
阅读全文
摘要:1.JSON 2.JQUERY的extends方法 3. function deepClone(obj){ let objClone = Array.isArray(obj)?[]:{}; if(obj && typeof obj "object"){ for(key in obj){ if(obj
阅读全文
摘要:function Promise (executor) { this.status = 'pending'; // 默认状态 this.value = void 0; // 默认值 undefined this.keepResolveFn = []; // 成功回调队列 this.keepRejec
阅读全文
摘要:class Promise{ //构造方法 constructor(executor){ //添加属性 this.PromiseState = 'pending'; this.PromiseResult = null; //声明属性 this.callbacks = []; //保存实例对象的 th
阅读全文
摘要:Array.prototype.reduceArr = function (fn, initValue) { if (Object.prototype.toString.call(fn) !== "[object Function]") { throw new Error('current para
阅读全文
摘要:实现call Function.prototype.myCall = function(thisArg, ...args) { const fn = Symbol('fn') // 声明一个独有的Symbol属性, 防止fn覆盖已有属性 thisArg = thisArg || window //
阅读全文

浙公网安备 33010602011771号