会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
远方的少年🐬
做正确的事,正确的做事,快乐的做事
博客园
首页
新随笔
管理
上一页
1
2
3
4
5
下一页
2022年2月24日
Taro init Demo
摘要: const inquirer = require('inquirer'); const chalk = require('chalk'); const DEFAULT_TEMPLATE_SRC = 'github:NervJS/taro-project-templates#v3.1' const D
阅读全文
posted @ 2022-02-24 15:12 远方的少年🐬
阅读(113)
评论(0)
推荐(0)
2022年2月21日
手写 Promise 队列
摘要: 支持限制并发数 class PromiseQueue { limit: number active: number queue: Array<() => Promise<any>> constructor(limit = 3) { // 并发限制 this.limit = limit; // 当前活
阅读全文
posted @ 2022-02-21 15:45 远方的少年🐬
阅读(100)
评论(0)
推荐(0)
2022年2月18日
Taro 3.1.0 源码分析
摘要: @tarojs/taro import Taro, { useDidShow } from '@tarojs/taro' 我们用的最频繁的包就是 @tarojs/taro // taro/index.js const { CurrentReconciler } = require('@tarojs/
阅读全文
posted @ 2022-02-18 18:15 远方的少年🐬
阅读(349)
评论(0)
推荐(0)
lodash 常用方法源码解析
摘要: chunk 将数组(array)拆分成多个 size 长度的区块,并将这些区块组成一个新数组。 如果array 无法被分割成全部等长的区块,那么最后剩余的元素将组成一个区块。 let newArray = chunk(array, 2); //将 array 分成两组 原理 var index =
阅读全文
posted @ 2022-02-18 10:10 远方的少年🐬
阅读(140)
评论(0)
推荐(0)
2022年2月16日
Taro 内置的 webpack 配置
摘要: 通过阅读 Taro 源码后可以知道,Taro 是在@tarojs/mini-runner/dist/index.js 文件中,调用了 webpack 进行打包。 export default async function build (appPath: string, config: IBuildC
阅读全文
posted @ 2022-02-16 11:32 远方的少年🐬
阅读(1617)
评论(0)
推荐(0)
async/await 语法糖
摘要: /** * 将 async/await 转为 generator 以 Promise 形式使用,可以在过程中随时打断/等待 * function build(appPath, config) { return awaiter(this, undefined, undefined, function*
阅读全文
posted @ 2022-02-16 09:44 远方的少年🐬
阅读(135)
评论(0)
推荐(0)
2022年2月15日
常用 Array api的用法
摘要: forEach forEach,对数组的每个元素执行一次给定的函数。 const array1 = ['a', 'b', 'c']; array1.forEach(element => console.log(element)); fill、map file,用一个固定值填充一个数组中从起始索引到终
阅读全文
posted @ 2022-02-15 17:01 远方的少年🐬
阅读(130)
评论(0)
推荐(0)
2022年2月7日
three pillars of javascript
摘要: 1.Types 类型 & Coercion 类型转换 Primitive Types 原始类型 underfined string number boolean object symbol null 其中 null,虽然是基本变量,但是因为设计的时候null是全 0,而object是 000 开头,
阅读全文
posted @ 2022-02-07 17:20 远方的少年🐬
阅读(58)
评论(0)
推荐(0)
2022年1月21日
TypeScript 中的泛型
摘要: 联合类型 interface Bird { name: string; fly(): void; } interface Person { name: string; talk(): void; } type BirdPerson = Bird | Person; let p: BirdPerson
阅读全文
posted @ 2022-01-21 16:58 远方的少年🐬
阅读(56)
评论(0)
推荐(0)
class 浅析
摘要: ES6 规范中,引入了 class 的概念。 但是 JS 中并没有一个真正的 class 原始类型, class 仅仅只是对原型对象运用语法糖。 函数声明和类声明之间的一个重要区别在于, 函数声明会提升,类声明不会。 class Cat{ constructor(name,age){ this.na
阅读全文
posted @ 2022-01-21 15:55 远方的少年🐬
阅读(66)
评论(0)
推荐(0)
上一页
1
2
3
4
5
下一页