摘要:
Install yarn add react-router-dom import: import * as ReactRouter from 'react-router-dom'; 路由器 - ReactRouter.Router 路由器主要分两种模式:history和hash,其中ReactRou 阅读全文
摘要:
示例 import * as React from 'react'; import mp4 from '!file-loader!@/a.mp4'; function save2file(canvas: HTMLCanvasElement) { var a = document.createElem 阅读全文
摘要:
代码 // 显示字幕下载标签页 let win = window.open(undefined); win.document.title = `下载字幕`; win.document.body.appendChild(window.wait_subtitle.cloneNode()); // 移花接 阅读全文
摘要:
防抖动的UI更新 如果在很短的时间内重复设置状态,那么UI不会每次都更新,这属于防抖动。 这说明 setState() 内部有调用时间间隔的检测机制。 合并状态 React会合并第一级 state 字段。 善用异步 为了确保 setState() 会触发更新,可以善用异步sleep函数,而不是 th 阅读全文
摘要:
创建script元素 var script = document.createElement('script'); document.head.appendChild(script); // insert into the <head></head> tag script.addEventListe 阅读全文
摘要:
# 阅读全文
摘要:
# 阅读全文
摘要:
函数定义 /** * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument * (`initialValue`). The returned obje 阅读全文
摘要:
# 阅读全文
摘要:
函数定义 /** * Accepts a function that contains imperative, possibly effectful code. * 接受包含命令性的,可能有效的代码的函数。 * * @param effect Imperative function that can 阅读全文
摘要:
函数定义 /** * Returns a stateful value, and a function to update it. * 返回一个有状态值,以及一个更新它的函数。 * * @version 16.8.0 * @see https://reactjs.org/docs/hooks-ref 阅读全文
摘要:
常识介绍 容器 人们谈论的视频文件格式其实就是容器格式。 媒体文件是既包括视频又包括音频、甚至还带有脚本的一个集合,因此被称为容器。 常见的流媒体技术的相关容器: .ts HLS技术下的视频切片容器 .flv HTTP+flv技术 音频视频编码 音频视频编码方案有很多,用百家争鸣形容不算过分,目前常 阅读全文
摘要:
Generate make file: Linux: ./auto/configure \ --prefix= \ --conf-path=conf/nginx.conf \ --pid-path=logs/nginx.pid \ --http-log-path=logs/access.log \ 阅读全文
摘要:
(双)选择排序 export var selectionSort: ArraySortAlgo = (array, start = 0, end = array.length) => { for (var i = start; i < end; i++) { var max = i; for (va 阅读全文
摘要:
全局安装模块 cnpm without --by=npm 模块将安装在%AppData%\npm\node_modules目录下, 列如: C:\Users\Administrator\AppData\Roaming\npm\node_modules. Ubuntu: /usr/local/lib/ 阅读全文
摘要:
什么是CodePoint 代码点是Unicode术语,从U+0到U+10FFFF都是代码点。一个代码点对应一个字符。 ES6新增String.fromCodePoint函数以及String#codePointAt函数(charCodeAt函数的修复版),这就意味着,Web平台下的JavaScript 阅读全文
摘要:
什么是tsconfig.json tsconfig.json是TypeScript编译器tsc的配置文件,可以避免tsc的冗长命令行参数,同时可以控制IDE(常见的Visual Studio Code)对TypeScript文件的行为。 使用tsc --locale zh-CN --all可以查看t 阅读全文
摘要:
"useBuiltIns" 默认为false, 不为每个文件自动添加polyfill,也不要进行转换import "core-js"或import "@babel/polyfill"更改为单个polyfill。 "usage": 按需导入填充物 填充物主要来自core-js、regenerator- 阅读全文
摘要:
Blob & File Blob:Binary large Object,二进制大对象。 不可变的原始数据的类似文件的对象, 可以读取为文本或二进制数据, 也可以转换为ReadableStream然后使用其方法来处理数据。 Blob ⇒ ArrayBuffer Blob对象有一个异步的arrayBu 阅读全文
摘要:
同一段“导入模块”的代码,截然不同的处理 Bug重现代码: void function () { isSupportedRange('http://static.com/1GB.bin').then(bool => { // ... }); }(); import * as http from 'h 阅读全文
摘要:
https HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module. HTTPS是基于TLS/SSL的HTTP协议。在Node.js中,这是作为一个单独的模块实现的。 h 阅读全文
摘要:
创建实例 诚然,对于简单的GET和POST请求,只需要设置一个目标URL和对应的HTTP请求体即可: import axios from 'axios'; axios.get('http://192.168.0.150:80/about') .then(response => { console.l 阅读全文
摘要:
body-parser 包body-parser属于express,原型如下: [Function] { json: [Getter], // application/json parser raw: [Getter], // application/octet-stream parser text 阅读全文
摘要:
红楼梦题词 朝代:近现代 作者:许南英 村言假语破情关,无奈空山石太顽。世事本空惟道释,家声半坏在钗环。 从知纨裤轻儇子,尽在衣冠世禄班。寄语观书观大略,先将绮障力除删! 所谓“绮障”,意涵两层:一为实义,二为寓意。在实义上,“绮障”为华丽的帐幕。简文帝萧纲有一首香艳四溢的诗,咏叹其内人昼眠:“北窗 阅读全文
摘要:
OSGB 目前市面上生产的倾斜模型,尤其Smart3D处理的倾斜摄影三维模型数据的组织方式一般是二进制存贮的、带有嵌入式链接纹理数据(.jpg)的OSGB格式。 Open Scene Gragh Binary是OSGB的全称,开放式场景二进制图像。 此类数据文件碎、数量多、高级别金字塔文件大等特点难 阅读全文
摘要:
安装 根据文档, 建议使用全局安装或使用与TypeScript兼容的编译器. $ yarn global add typescript yarn global v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] L 阅读全文
摘要:
tsc watch模式,具有webpack的模块概念,不会因为不在依赖链中的文件的事件触发编译。 tsc --watch ts-node 安装: $ yarn global add ts-node ts-loader 配合webpack使用,前端是一定需要编译的,但是有babel,还有后端,好乱。 阅读全文
摘要:
tsc 优点:可以生成.d.ts类型声明文件。 tsconfig.json: { "compilerOptions": { "outDir": "dist", "declaration": true, "declarationDir": "dist", }, "files": ["src/index 阅读全文
摘要:
webpackUniversalModuleDefinition 通用模块定义: (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports 'object' && typeof module 'obje 阅读全文
摘要:
webpack.config.js 相关字段 output.libraryTarget 包括var(默认值,用于web场景)、umd、commonjs[2]、amd等选项,如果webpack编译后在其它包中导入时一直是空对象,那么你该了解一下这个字段了。 output: { filename: '[ 阅读全文
摘要:
Webpack5的变化 前端开发变化, 开箱即用webpack serve命令,只需要安装webpack-dev-server就可以直接启用了。 $ webpack serve --help Usage: webpack s | serve Description: Run the webpack 阅读全文
摘要:
CLI 应用程序 CLI 应用程序需要在Windows和Unix-like两种系统上运行, 通常是包装两个命令行脚本(cmd脚本和shell脚本, ps1不讨论)添加到系统路径中. 第一步, 在package.json中设置bin字段 { "name": "FileBrowser", "versio 阅读全文
摘要:
安装与使用 从源码安装:https://docs.evergreen-ils.org/2.1/html/InstallingPostgreSQL.html 假设安装到目录F:\PostgreSQL\9.5, 那么在F:\PostgreSQL\9.5\bin下有以下几个程序可以控制SQL: psql. 阅读全文
摘要:
设置HTTP代理 git config --global http.proxy http://127.0.0.1:25378 取消HTTP代理 git config --global --unset http.proxy 设置socks5代理 方案1, 来自: https://stackoverfl 阅读全文
摘要:
安装 https://classic.yarnpkg.com/zh-Hans/docs/install 查询与更换源 yarn config get registry yarn config set registry https://registry.npm.taobao.org/ 使用方法:安装依 阅读全文
摘要:
GTX 1660 Super 显卡发布时间:2019/10/29 1660s比1660ti弱一些,價錢高。 NVIDIA 系统信息报告,创建于: 10/14/2020 10:04:05 系统名称: DESKTOP-G06PENK [显示] 操作系统: Windows 10 Pro, 64-bit D 阅读全文
摘要:
定义与分配 分配就是传统的赋值, 包括在类构造函数中的赋值, 也是分配. 定义则是调用以下函数: Object.defineProperty(obj, propName, propDesc) https://2ality.com/2012/08/property-definition-assignm 阅读全文
摘要:
MDN中文 在使用 JavaScript 编写 Web 代码时,有许多 Web API 可供调用。可通过下面的链接访问开发Web应用程序或网站时可能使用的所有API和接口(对象类型)的列表。 https://developer.mozilla.org/zh-CN/docs/Web/API 阅读全文