摘要: 踩坑,特此记录 场景:在多人协作的情况下,vue.config.js中 单独切出来的 proxy devServer文件经常被修改,但我又不想让这个devServer文件在切换分支的时候提交或git stash. 此时一开始想到的是.gitignore,但.gitignore是针对远程的,git忽略 阅读全文
posted @ 2022-03-03 16:33 纯、臻 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 此博客只用于个人复习用 先上大O符号所有的复杂度 时间复杂度 时间复杂度为O(1) 的例子:常量或变量的加减乘除 时间复杂度为O(n) 的例子:不嵌套的for while循环 时间复杂度为O(n^2)的例子,循环嵌套两个for 如果一个算法的时间复杂度有O(n)和O(n^2)两种方法,肯定是选时间复 阅读全文
posted @ 2021-12-11 17:30 纯、臻 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 联合类型和类型保护 联合类型 | // 联合类型和类型保护 interface Bird { fly: boolean sing: () => {} } interface Dog { fly: boolean bark: () => {} } //联合类型 function trainAnial( 阅读全文
posted @ 2021-12-09 15:41 纯、臻 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 基础类型 null undefined symbol boolean void const count: number = 123; const teacher: string = "zhen"; 对象类型 //对象类型 // 对象 const teacher: { name: string; ag 阅读全文
posted @ 2021-12-06 01:31 纯、臻 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 组合继承(为什么叫组合继承,组合继承就是构造函数继承和原型链继承的组合) // 组合继承(只需要注意两点) // 第一点:继承father的属性值。在Children构造函数中调用Father.call(this,val) (构造函数继承) // 第二点:继承father的方法。let aa = n 阅读全文
posted @ 2021-11-15 17:22 纯、臻 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 判断类型(通用类型检测方法) const isTypeOf = (data) => { return Object.prototype.toString.call(data).replace(/\[object (\w+)\]/, '$1').toLowerCase() } console.log( 阅读全文
posted @ 2021-10-29 17:15 纯、臻 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 研究组件的注册//组件注册// ASSET_TYPES = ['component','filter','directive'] ASSET_TYPES.forEach(type => { // 声明静态的方法: Vue.component = function(){} // 平时声明的组件是Vue 阅读全文
posted @ 2021-10-26 14:47 纯、臻 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 一、理解Vue批量异步更新策略 异步更新队列:Vue高效的秘诀是批量、异步的更新策略 首先来了解下Event Loop事件循环机制 事件循环Event Loop:浏览器为了协调事件处理、脚本执行、网络请求和渲染等任务而制定的工作机制 看源码执行过程 在Object.defineReactive()中 阅读全文
posted @ 2021-10-22 18:12 纯、臻 阅读(146) 评论(0) 推荐(0) 编辑
摘要: src\platforms\web\entry-runtime-with-compiler.js 源码开始位置(引入了Vue构造函数) 扩展$mount,处理可能存在的templete或者el选项,重新编译template为render函数 src\platforms\web\runtime\ind 阅读全文
posted @ 2021-10-21 17:59 纯、臻 阅读(404) 评论(0) 推荐(0) 编辑
摘要: template <template> <div class="hello"> <h1>{{ msg }}</h1> <p @click="$store.commit('add')">counter: {{$store.state.counter}}</p> <p @click="$store.di 阅读全文
posted @ 2021-10-18 00:39 纯、臻 阅读(55) 评论(0) 推荐(0) 编辑