Recent Posts
-
Angular Custom Slots
Option One (Directive) item.directive.ts import { Input , Directive , TemplateRef , EmbeddedViewRef , ViewContainerRef , } from ' @angular/core ' ; @ Directive ({ selector : ' [ListItem] ' , }) export class ListItem { private _context : any ; private _viewRef : EmbeddedViewRef < any >; constructor ( private viewContainer : ViewContainerRef , public templateRef : TemplateRef < any > ) { this . _viewRef = this . viewContainer . createEmbeddedView (templateRef); } @ Input ()
Updated: -
Potree - Get all points in pointcloud
Background When using potree( potree-core ) to load a large point cloud dataset, it involves the scenario of obtaining all point cloud data for processing, so this method is in place. Core Code function getPoints () { const position = new Float32Array ( MAX_POINTS * 3 ); const intensity = new Float32Array ( MAX_POINTS ); const matrixCache = new Map < PointCloudOctree , THREE . Matrix4 > (); this . pointClouds . forEach ( ( pointCloud ) => { matrixCache . set (pointCloud , pointCloud .
-
浏览器存储
cookie,localStorage,sessionStorage,indexDB 特性 cookie localStorage sessionStorage indexDB 数据生命周期 一般由服务器生成,可以设置过期时间 除非被清理,否则一直存在 页面关闭就清理 除非被清理,否则一直存在 数据存储大小 4K 5M 5M 无限 与服务端通信 每次都会携带在 header 中,对于请求性能影响 不参与 不参与 不参与 从上表可以看大,cookie 已经不建议用于存储。如果没有大量数据存储需求的话,可以使用 localStorage 和 sessionStorage 。对于不怎么改变的数据尽量使用 localStorage 存储,
Updated: -
记录一次微前端实践
技术选型 微前端框架:qiankun、single-spa-angular 主应用:angular 16 子应用:angular 16 项目搭建 主应用配置 安装 qiankun 增加子应用加载入口组件 micro-app.component.ts import { Component , ElementRef , OnInit } from ' @angular/core ' ; import { ActivatedRoute } from ' @angular/router ' ; import { MicroApp , loadMicroApp } from ' qiankun ' ; @ Component ({ selector : ' micro-app ' , template : ` <div id="haydnSccMicroApp"></div> ` , })
-
git submodule
添加 git submodule add <url> <path> url:子模块仓库地址 path:本地存放路径 初始化 git submodule update --init --recursive 或者 git submodule init git submodule update 更新 cd <path> git pull origin <branch> 删除 删除submodule缓存 git rm --cached <path> 删除submodule目录 rm -rf <path> 删除文件 .gitmodules 中对应子模块内容 删除 .git/modules 对应子模块目录 rm -rf .git/modules/<path> 删除 .
Updated: