手写Vue3响应式
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102const observeWeakMap = new WeakMap();let activeEffect = null;// 添加执行副作用函数并收集依赖export const effect = (eff) => { activeEffect = eff; activeEffect(); activeEffect = null;};// activeEffect执行时如果有触发get,则执行track// 将响应式对象的副作用函数收集到一个weakMapconst track = (target, key) => { if (activeEff ...
手写promise
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263function MyPromise(fn) { let state = "pending"; let value = null; const callbacks = []; this.then = function (onFulfilled) { return new MyPromise((resolve, reject) => { handle({ //桥梁,将新 Promise 的 resolve 方法,放到前一个 promise 的回调对象中 onFulfilled, resolve, }); }); }; function handle(callback) { ...
javascript-encoding
Does JavaScript use UCS-2 or UTF-16 encoding? Since I couldn’t find a definitive answer to this question anywhere, I decided to look into it. The answer depends on what you’re referring to: the JavaScript engine, or JavaScript at the language level.
Let’s start with the basics…
The notorious BMPUnicode identifies characters by an unambiguous name and an integer number called its code point. For example, the © character is named “copyright sign” and has U+00A9 — 0xA9 can be written as 169 in deci ...
Vue乾坤微应用的使用和部署
Vue 主应用注册微应用1234567891011121314151617181920212223242526import { start, addGlobalUncaughtErrorHandler, registerMicroApps,} from "qiankun";//注册微应用const apps = [ { name: "micro-app1", entry: "/micro-app1/", //入口 两端必须有'/' container: "sub-app-container", // 微应用挂载的DOM activeRule: "/app1", // props: { menuName: "微应用APP1", submenu: [{ menuUrl: "/app1/dashboard", menuName: ...
element-plus笔记
element-plus 结构和依赖monorepositories
123456789101112131415161718192021222324252627282930element-plus├── CHANGELOG.en-US.md # Changelog├── CODE_OF_CONDUCT.md # Contributor Covenant Code of Conduct├── CONTRIBUTING.md # How To Contribute├── LICENSE├── README.md├── breakings #├── codecov.yml # https://docs.codecov.com/docs/codecov-yaml├── commitlint.config.js #cz-git https://cz-git.qbb.sh/zh/cli/├── commitlint.config.ts├── docs├── global.d.ts├── internal #构建eslint相关├── package.json├── packages # 主体代码├ ...
算法笔记2022
判断质数的方法详细内容参考 leetcode 题解计数质数
列举三种方法枚举法12345678910111213141516const isPrime = (x) => { for (let i = 2; i * i <= x; ++i) { if (x % i == 0) { return false; } } return true;};var countPrimes = function (n) { let ans = 0; for (let i = 2; i < n; ++i) { ans += isPrime(i); } return ans;};
埃氏筛12345678910111213var countPrimes = function (n) { const isPrime = new Array(n).fill(1); let ans = 0; for (let i = 2; i < n ...
前端工具链
编译器babel tsc esbuild swc
文章:
2022使用的工具链
babel vs tsc
webpackvite
egg
问题汇总csrfpostman csrf 报错
123456// config/config.default.jsconfig.security = { csrf: { enable: false, // 关闭csrf },};
egg-mysqldocs一、安装
1npm i egg-mysql --save-dev
二、配置 Plugin
12345678910111213141516171819202122// config/config.default.jsmodule.exports = appInfo => { config.mysql = { client: { host: '192.168.2.3', port: '3306', user: 'egg', password: 'egg', database: 'egg' ...
Mysql8
docker 运行 mysql8简书博客
创建用户命令:
1CREATE USER 'username'@'host' IDENTIFIED BY 'password';
说明:username:你将创建的用户名host:指定该用户在哪个主机上可以登陆,如果是本地用户可用 localhost,如果想让该用户可以从任意远程主机登陆,可以使用通配符%password:该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器例子:
12345CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456';CREATE USER 'pig'@'192.168.1.101_' IDENDIFIED BY '123456';CREATE USER 'pig'@'%' IDENTIFIED BY '123456 ...
我的面试题
1. 面试自我介绍
“面试官您好,非常荣幸参与贵公司**职位的应聘,下面我简单介绍一下我的个人情况,基本信息之类的简历上都有,就不再重复,
首先介绍一下之前的工作经验……(挑一些跟应聘岗位有链接的内容说,如果有工作荣誉,千万不要漏掉)……,
之所以离开上一家公司是出于……考虑(离职理由要正当,尽可能从职业发展的角度出发)……
通过渠道关注到贵公司岗位的招聘信息,该职位跟我未来的职业发展相对契合,而且贵公司的业务(或者企业实力、行业口碑、企业文化等)对我都非常有吸引力,非常渴望能够进入贵公司发展……
我个人的基本情况是(受教育情况、婚育、住所、家庭简单情况),闲暇之余,我一般会做些**事情(有意义的)……
或许在所有的求职者当中,我不是最优秀的,但如果贵公司能够给我这个工作机会,我有信心,也有决心做好这份工作,以上是我的个人基本情况,希望今天自己面试有好的表现,未来有幸与诸位面试官共事,也预祝各位度过美好的一天。”
1. CSSposition 属性的介绍
1、absolute2、relative3、fixed4、sticky
flex 布局的使用垂直水平居中2. jsQ:深拷贝浅拷 ...