随笔分类 -  js

摘要:配置 { type: 'custom', data: uds.map((e, i) => [i, ...e.oclh]), encode: { x: 0, y: [1, 2, 3, 4], tooltip: [1, 2, 3, 4], }, renderItem: this.US_Line, } / 阅读全文
posted @ 2024-10-15 23:00 Ajanuw 阅读(22) 评论(0) 推荐(0)
摘要:let count = 0, maxCount = 3; function event() { count += 1; console.log(count); return count < maxCount; } let prev = 0; const t = 1000; // 1秒 functio 阅读全文
posted @ 2022-08-17 10:08 Ajanuw 阅读(372) 评论(0) 推荐(0)
摘要:枚举本地字体 <button id="btn">Get Local Font</button> document .getElementById("btn") .addEventListener("click", async function () { const pickedFonts = awa 阅读全文
posted @ 2022-07-28 10:20 Ajanuw 阅读(626) 评论(0) 推荐(0)
摘要:class UpperCaseTransformStream { constructor() { return new TransformStream({ transform(chunk, controller) { controller.enqueue(chunk.toUpperCase()); 阅读全文
posted @ 2022-07-28 09:53 Ajanuw 阅读(417) 评论(0) 推荐(0)
摘要:全局配置 local 和 插件,通常在你的入口函数中调用 import dayjs from "dayjs"; import weekday from "dayjs/plugin/weekday"; import "dayjs/locale/zh-cn"; // config dayjs dayjs 阅读全文
posted @ 2021-09-15 12:37 Ajanuw 阅读(1585) 评论(0) 推荐(0)
摘要:console.log( window.crypto.randomUUID() ) See also: crypto.randomUUID() 阅读全文
posted @ 2021-08-01 09:44 Ajanuw 阅读(405) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" data-name="vs/editor/editor. 阅读全文
posted @ 2021-02-11 18:01 Ajanuw 阅读(1301) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-10 17:48 Ajanuw 阅读(60) 评论(0) 推荐(0)
摘要:test html <p>title</p> <ul class="list a" id="list"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <footer>footer</footer> function xpath(path, pa 阅读全文
posted @ 2021-02-04 11:10 Ajanuw 阅读(88) 评论(0) 推荐(0)
摘要:See alsoe: https://www.runoob.com/html/html5-draganddrop.html https://developer.mozilla.org/zh-CN/docs/Web/API/HTML_Drag_and_Drop_API 阅读全文
posted @ 2021-01-31 15:07 Ajanuw 阅读(89) 评论(0) 推荐(0)
摘要:let emoji_exp = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g; function estring(str) { const ms 阅读全文
posted @ 2020-12-26 16:24 Ajanuw 阅读(876) 评论(0) 推荐(0)
摘要:class A {} const proxy = new Proxy(new A(), { get(o, k) { if (!/\d+/.test(k.toString())) return o[k]; if (!o.prototype) o.prototype = {}; if (!o.proto 阅读全文
posted @ 2020-12-24 16:13 Ajanuw 阅读(328) 评论(0) 推荐(0)
摘要:通常用于google搜索 See also: video 探索搜索库 阅读全文
posted @ 2020-12-22 15:02 Ajanuw 阅读(64) 评论(0) 推荐(0)
摘要:在js中与第三方设备的通信 这是一个Xbox One手柄的demo,将手柄使用USB连接到PC上: See also: video Device APIs 通过JavaScript与蓝牙设备通信 在网络上访问USB设备 在Android版Chrome上与NFC设备互动 Serial port 连接到 阅读全文
posted @ 2020-12-22 13:59 Ajanuw 阅读(139) 评论(0) 推荐(0)
摘要:let data = { name: "ajanuw", change() { this.name = "Ajanuw"; }, get message() { console.log(this); return "hello " + this.name; }, }; console.log( Ob 阅读全文
posted @ 2020-12-20 13:54 Ajanuw 阅读(178) 评论(0) 推荐(0)
摘要:<form action="/verify-otp" method="POST"> <input type="text" inputmode="numeric" autocomplete="one-time-code" pattern="\d{6}" required> </form> naviga 阅读全文
posted @ 2020-12-17 11:35 Ajanuw 阅读(251) 评论(0) 推荐(0)
摘要:optimization: { minimizer: [ new TerserJSPlugin({ terserOptions: { format: { comments: /(\s*#if)|(\s*#end)/i, }, }, }), ], }, // #ifdef H5 // #endif 阅读全文
posted @ 2020-12-12 12:43 Ajanuw 阅读(799) 评论(0) 推荐(0)
摘要:function myParseInt(str: string): number { let result = NaN; for (let i = 0; i < str.length; i++) { const dec: number = str.charCodeAt(i); if (dec < 4 阅读全文
posted @ 2020-12-10 11:01 Ajanuw 阅读(241) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Docum 阅读全文
posted @ 2020-11-08 10:48 Ajanuw 阅读(1106) 评论(0) 推荐(0)
摘要:创建webasm字符串模板 my-module.wat: (module (func $add (param $a i32) (param $b i32) (result i32) (i32.add (local.get $a) (local.get $b) ) ) (export "add" (f 阅读全文
posted @ 2020-10-28 12:00 Ajanuw 阅读(324) 评论(0) 推荐(1)