摘要:
通過 containsPoint 方法坐標是否在某個元素內 const rect = new fabric.Rect({ width: 100, height: 100, fill: 'red', }) canvas.add(rect); canvas.on('mousee:down', (even
閱讀全文
posted @ 2023-08-21 18:43
淺唱年華1920
閱讀(362)
推薦(0)
摘要:
鏈表實現隊列 /** * 1.單項鏈表實現隊列,但要同時記錄head和tail * 2.要從tail入隊,head出對, 否則出隊時,tail不好定位 * 2.單獨記錄length,不可遍歷鏈表獲取length */ class MyQueue { head = null; // 頭 tail =
閱讀全文
posted @ 2023-07-01 12:10
淺唱年華1920
閱讀(30)
推薦(0)
摘要:
/** * 數組轉鏈路表數據 - {value: A, next: {value: B, next: {value: C}} * @param {*} list arr * @returns */ function createLink(list) { let length = list.lengt
閱讀全文
posted @ 2023-07-01 11:09
淺唱年華1920
閱讀(59)
推薦(0)
摘要:
vue中 數據驅動視圖更新,是通過數據監聽實現,也就是響應式 在vue2中通過 Object.defineProperty實現響應式,實現思路如下 監聽對象,深度監聽通過遞歸 數組監聽通過重寫數組原型方法 // 重新定義數組原型 const oldArrayPrototty = Array.prot
閱讀全文
posted @ 2023-05-24 14:50
淺唱年華1920
閱讀(24)
推薦(0)
摘要:
深度比較 function isObject(obj) { return typeof obj 'object' && obj !== null } function isEqual(obj1, obj2) { if (!isObject(obj1) || !isObject(obj2)) { re
閱讀全文
posted @ 2023-05-19 17:52
淺唱年華1920
閱讀(34)
推薦(0)
摘要:
通過es5 實現 類繼承 通過super 給父級傳參的效果 先看看 原型繼承 function es5parent(name, age) { this.name = name; this.age = age; } es5parent.prototype.say = function() { cons
閱讀全文
posted @ 2023-03-31 11:23
淺唱年華1920
閱讀(130)
推薦(0)
摘要:
call Function.prototype.mycall = function(context, ...args) { if (this Function.prototype) { return undefined; } context = context || window; const fn
閱讀全文
posted @ 2023-03-30 16:19
淺唱年華1920
閱讀(30)
推薦(0)
摘要:
導入包 import {Vector as VectorLayer, Heatmap as HeatmapLayer} from 'ol/layer'; import { Vector as VectorSource } from 'ol/source'; import Feature from "
閱讀全文
posted @ 2022-10-27 10:36
淺唱年華1920
閱讀(477)
推薦(0)
摘要:
先地圖初始化然后再添加圖層 import {Vector as VectorLayer} from 'ol/layer'; import { Vector as VectorSource } from 'ol/source'; import { GeoJSON } from 'ol/format';
閱讀全文
posted @ 2022-10-27 10:19
淺唱年華1920
閱讀(374)
推薦(0)
摘要:
// 導航欄點擊事件 toolbar.setOnClickListener{ // 打開側滑欄 drawerLayout.openDrawer(leftSlideView); // 關閉側滑欄 // drawerLayout.closeDrawer(leftSlideView); }
閱讀全文
posted @ 2021-07-08 18:27
淺唱年華1920
閱讀(92)
推薦(0)