上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 34 下一页

2018年9月27日

为什么js 的constructor中是无限循环嵌套:Foo.__proto__.constructor.prototype.constructor.prototype.constructor.prototype.xxx ?

摘要: constructor始终指向创建当前对象实例的(构造)函数。 任何函数都是Function类的一个实例 那么根据上述可知:任何函数的constructor属性都指向Function类,而Function类的constructor又指向谁呢?其实也是Function类本身,也就构成了一个递归。 阅读全文

posted @ 2018-09-27 21:23 cag2050 阅读(649) 评论(0) 推荐(0)

2018年9月26日

实例对象与 new 命令

摘要: 引用:https://wangdoc.com/javascript/oop/new.html JavaScript 语言的对象体系,不是基于“类”的,而是基于构造函数(constructor)和原型链(prototype)。 JavaScript 语言使用构造函数(constructor)作为对象的 阅读全文

posted @ 2018-09-26 21:52 cag2050 阅读(238) 评论(0) 推荐(0)

JavaScript 隐式类型转换之:加号+

摘要: 加号+,有些情况下,它是算术加号,有些情况下,是字符串连接符号 如果字符串和数字相加,JavaScript会自动把数字转换成字符,不管数字在前还是字符串在前 此外,需要注意的是,“+”的运算方向是从左到右的,如下: 这与下面是等价的: 相比之下,下面的结果是不一样的: 阅读全文

posted @ 2018-09-26 00:04 cag2050 阅读(861) 评论(0) 推荐(0)

2018年9月25日

变量提升、函数提升,以及它们的优先级

摘要: 全部解析,详见github:https://github.com/cag2050/var_function_hoisting 变量提升 console.log(a) var a / 以上代码等价于 ` var a console.log(a) ` / // 只有函数声明才有变量提升。 console 阅读全文

posted @ 2018-09-25 21:50 cag2050 阅读(465) 评论(0) 推荐(0)

函数防抖(Debounce)、函数节流 (Throttle)

摘要: 一篇介绍文章:https://zhuanlan.zhihu.com/p/38313717 演示示例:http://demo.nimius.net/debounce_throttle/ 函数防抖(Debounce) 比较好的解释:https://www.jianshu.com/p/3e8e31f996 阅读全文

posted @ 2018-09-25 01:12 cag2050 阅读(932) 评论(0) 推荐(0)

2018年9月23日

React V16.x 生命周期调整

摘要: 旧声明周期: table th:nth of type(5) { width: 400px; } 生命周期 | 属于阶段 | 调用次数 | 是否可以setState | 作用 | | | | getDefaultProps | 创建阶段(Mounting) | 1次(全局调用1次) | 不可以 | 阅读全文

posted @ 2018-09-23 15:09 cag2050 阅读(660) 评论(0) 推荐(0)

向github提交代码不用输入帐号密码

摘要: 出处:https://segmentfault.com/a/1190000008435592 阅读全文

posted @ 2018-09-23 14:03 cag2050 阅读(426) 评论(0) 推荐(0)

2018年9月22日

事件委托(event delegation) 或叫 事件代理

摘要: 比较好的介绍文章: 关于事件委托的整理 ,另附bind,live,delegate,on区别:https://www.cnblogs.com/MagicZhao123/p/5980957.html js中的事件委托或是事件代理详解:https://www.cnblogs.com/liugang vi 阅读全文

posted @ 2018-09-22 00:06 cag2050 阅读(1056) 评论(0) 推荐(0)

2018年9月20日

js 的深拷贝

摘要: 出处:https://www.cnblogs.com/Chen XiaoJun/p/6217373.html 阅读全文

posted @ 2018-09-20 21:32 cag2050 阅读(112) 评论(0) 推荐(0)

2018年9月15日

python 术语

摘要: python 术语 术语英文 | 术语中文 | 说明 | | PyPI(Python Package Index)| | 搜索python包的网站:https://pypi.org/ pip、easy_install | 包管理工具 | 安装第三方模块 Anaconda | 内置了许多非常有用的第三 阅读全文

posted @ 2018-09-15 00:49 cag2050 阅读(320) 评论(0) 推荐(0)

2018年9月7日

gaea-basic-components 知识点

摘要: github:https://github.com/ascoders/gaea basic components 阅读全文

posted @ 2018-09-07 15:28 cag2050 阅读(188) 评论(0) 推荐(0)

2018年9月5日

pri 知识点

摘要: pri github:https://github.com/prijs/pri 添加路由后动态导入,使用的是 react loadable:https://github.com/jamiebuilds/react loadable。 等价于 运行 时,选择项目类型(有3种:Project、Compo 阅读全文

posted @ 2018-09-05 11:18 cag2050 阅读(513) 评论(0) 推荐(0)

2018年9月4日

react-router、react-router-dom、react-router-native 关系

摘要: react router 为 React Router 提供核心路由功能,但是你不需要直接安装 react router; 如果你写浏览器端应用,你应该安装 react router dom; 如果你写 React Native 应用,你应该安装 react router native; 当你安装 阅读全文

posted @ 2018-09-04 11:45 cag2050 阅读(1217) 评论(0) 推荐(0)

2018年9月3日

ts项目报错:Import sources within a group must be alphabetized

摘要: 报错: 原因:import名称排序问题,要求按照字母从小到大排序;修改 tslint.json 中 rules 的规则 “ordered imports” 为 false 即可。 解决: 阅读全文

posted @ 2018-09-03 13:07 cag2050 阅读(6248) 评论(0) 推荐(0)

2018年8月31日

TypeScript 之 tsconfig.json

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/tsconfig.json.html 如果一个目录下存在一个tsconfig.json文件,那么它意味着这个目录是TypeScript项目的根目录。 tsconfig. 阅读全文

posted @ 2018-08-31 10:41 cag2050 阅读(467) 评论(0) 推荐(0)

2018年8月30日

TypeScript 之 声明文件的结构

摘要: https://www.tslang.cn/docs/handbook/declaration files/library structures.html 模块化库 一些库只能工作在模块加载器的环境下。 比如,像 express只能在Node.js里工作所以必须使用CommonJS的require函 阅读全文

posted @ 2018-08-30 18:14 cag2050 阅读(718) 评论(0) 推荐(0)

TypeScript 之 声明文件的使用

摘要: https://www.tslang.cn/docs/handbook/declaration files/consumption.html 下载 在TypeScript 2.0以上的版本,获取类型声明文件只需要使用npm。 比如,获取lodash库的声明文件,只需使用下面的命令: 如果一个npm包 阅读全文

posted @ 2018-08-30 16:15 cag2050 阅读(1034) 评论(0) 推荐(0)

TypeScript 之 声明文件的发布

摘要: https://www.tslang.cn/docs/handbook/declaration files/publishing.html 发布声明文件到npm,有两种方式: 1. 与你的npm包捆绑在一起(推荐) 2. 发布到npm上的@types organization。 包含声明文件到你的n 阅读全文

posted @ 2018-08-30 15:04 cag2050 阅读(491) 评论(0) 推荐(0)

TypeScript 之 NPM包的类型

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Typings%20for%20NPM%20Packages.html 你的定义文件应该: 1. 是.d.ts文件 2. 写做外部模块 3. 不包含 引用 阅读全文

posted @ 2018-08-30 09:59 cag2050 阅读(813) 评论(0) 推荐(0)

2018年8月29日

create-react-app-typescript 知识点

摘要: github:https://github.com/wmonk/create react app typescript 报错: 原因:import名称排序问题,要求按照字母从小到大排序;修改rules的规则“ordered imports”为false即可。 解决:https://cdn2.jian 阅读全文

posted @ 2018-08-29 15:54 cag2050 阅读(941) 评论(0) 推荐(0)

TypeScript 之 泛型

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Generics.html 泛型:可以支持多种类型的数据 泛型函数的定义 这里使用了类型变量,它是一种特殊的变量,只用于表示类型而不是值。 我们给identity添加了 阅读全文

posted @ 2018-08-29 14:17 cag2050 阅读(140) 评论(0) 推荐(0)

TypeScript 之 类型推导

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Type%20Inference.html 类型推导:发生在初始化变量和成员,设置默认参数值和决定函数返回值时。 最佳通用类型 计算通用类型算法会考虑所有的候选类型,并 阅读全文

posted @ 2018-08-29 12:03 cag2050 阅读(1281) 评论(0) 推荐(0)

TypeScript 之 JSX

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/JSX.html JSX中,类型断言必须使用as操作符。 类型检查 固有元素:环境自带的某些东西(比如,在DOM环境里的div或span)。 基于值的元素:你自定义的组 阅读全文

posted @ 2018-08-29 11:44 cag2050 阅读(1671) 评论(0) 推荐(0)

TypeScript 之 书写.d.ts文件

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Writing%20Definition%20Files.html 类的分解 TypeScript的类会创建出两个类型: 1. 实例类型,定义了类的实例具有哪些成员; 阅读全文

posted @ 2018-08-29 11:01 cag2050 阅读(1635) 评论(0) 推荐(0)

2018年8月28日

TypeScript 之 函数

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Functions.html 为函数定义类型 为函数添加类型: TypeScript能够根据返回语句自动推断出返回值类型,因此我们通常省略它。 TypeScript中, 阅读全文

posted @ 2018-08-28 19:06 cag2050 阅读(116) 评论(0) 推荐(0)

TypeScript 之 基础类型、高级类型

摘要: 基础类型:https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Basic%20Types.html 高级类型:https://m.runoob.com/manual/gitbook/TypeScript/_book/do 阅读全文

posted @ 2018-08-28 11:55 cag2050 阅读(270) 评论(0) 推荐(0)

TypeScript 之 三斜线指令

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Triple Slash%20Directives.html 一个三斜线引用路径是相对于包含它的文件的,如果不是根文件。 三斜线指令 : 用于声明文件间的依赖,告诉编译 阅读全文

posted @ 2018-08-28 11:18 cag2050 阅读(1218) 评论(0) 推荐(1)

TypeScript 与 es6 写法的区别

摘要: import 方式 ts 默认对于 commonjs 的模块是这样加载的: es6: 不想改变 es6 的写法,可以使用 ts 提供的一个编译参数 : 阅读全文

posted @ 2018-08-28 11:07 cag2050 阅读(848) 评论(0) 推荐(0)

TypeScript 之 模块

摘要: https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Modules.html 外部模块简写 外部模块简写: 的含义: 告诉编译器,以 结尾的模块存在、且导出的值的类型为 。 阅读全文

posted @ 2018-08-28 10:40 cag2050 阅读(199) 评论(0) 推荐(0)

2018年8月26日

gaea-basic-components 知识点

摘要: github 地址:https://github.com/ascoders/gaea basic components 阅读全文

posted @ 2018-08-26 12:03 cag2050 阅读(227) 评论(0) 推荐(0)

gaea-editor 知识点

摘要: github 地址:https://github.com/ascoders/gaea editor 阅读全文

posted @ 2018-08-26 12:02 cag2050 阅读(372) 评论(0) 推荐(0)

2018年8月23日

git submodule的使用(.gitmodules文件子模块加载)

摘要: https://blog.csdn.net/qq_27295403/article/details/80486116 阅读全文

posted @ 2018-08-23 16:41 cag2050 阅读(2748) 评论(0) 推荐(0)

2018年8月17日

React 中的 Component、PureComponent、无状态组件 之间的比较

摘要: React 中的 Component、PureComponent、无状态组件之间的比较 table th:first of type { width: 150px; } 组件类型 | 说明 | React.createClass | 不使用ES6语法,只能使用 React.createClass 来 阅读全文

posted @ 2018-08-17 14:33 cag2050 阅读(1220) 评论(1) 推荐(0)

2018年8月9日

在vue-cli 2.x 项目中,引入stylus的全局CSS变量

摘要: 出处:https://blog.csdn.net/weixin_39378610/article/details/81140358 阅读全文

posted @ 2018-08-09 15:38 cag2050 阅读(1159) 评论(0) 推荐(0)

2018年7月31日

create-react-app 搭建的项目中,使用 CSS Modules

摘要: create react app 搭建的项目中,使用 CSS Modules: 修改config目录下 webpack.config.dev.js 和 webpack.config.prod.js 文件: CSS Modules 与 stylus 结合: create react app引入styl 阅读全文

posted @ 2018-07-31 10:20 cag2050 阅读(445) 评论(0) 推荐(0)

2018年7月30日

Nginx + keepalived 双机热备(主从模式)

摘要: 双机高可用一般是通过虚拟IP(飘移IP)方法来实现的,基于Linux/Unix的IP别名技术。 双机高可用方法目前分为两种: 1)双机主从模式:即前端使用两台服务器,一台主服务器和一台热备服务器,正常情况下,主服务器绑定一个公网虚拟IP,提供负载均衡服务,热备服务器处于空闲状态;当主服务器发生故障时 阅读全文

posted @ 2018-07-30 11:55 cag2050 阅读(171) 评论(0) 推荐(0)

2018年7月25日

从后端接口下载文件的2种方式:get方式、post方式

摘要: 从后端接口下载文件的2种方式 一、get方式 直接使用: 二、post方式 当有文件需要传给后端接口、后端处理后返回文件时,用post方式发送formdata。 此时下载后端返回的文件,流程: 1、后端设置Response Headers的2个值: 2、前端处理下blob文件: 以vue、vue r 阅读全文

posted @ 2018-07-25 11:00 cag2050 阅读(3193) 评论(0) 推荐(0)

2018年7月19日

Visual Studio Code 使用

摘要: VS Code 快捷键: 快捷键 | 作用 | Option+Up 或 Option+Down | 上下移动一行 Shift+Option+Up 或 Shift+Option+Down | 向上向下复制一行 VS Code 设置 设置 | 作用 | Preferences Settings USER 阅读全文

posted @ 2018-07-19 10:26 cag2050 阅读(147) 评论(0) 推荐(0)

2018年7月15日

ES6 中 Class 与 TypeScript 中 Class 的区别(待补充)

摘要: ES6 中 Class 与 TypeScript 中 Class 的区别(待补充) 阅读全文

posted @ 2018-07-15 13:43 cag2050 阅读(273) 评论(0) 推荐(0)

2018年7月14日

gaea-editor 项目使用

摘要: 项目地址:https://github.com/ascoders/gaea editor 打开编辑器界面:运行 下载gaea editor项目,进行调试,注意点: gaea editor/packages 中,需要下载 gaea render:https://github.com/ascoders/ 阅读全文

posted @ 2018-07-14 12:16 cag2050 阅读(1587) 评论(0) 推荐(0)

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 34 下一页

导航