Posts
All the articles I've posted.
-
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 .
-
记录一次微前端实践
技术选型 微前端框架: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: -
浏览器渲染机制
渲染流程 浏览器的渲染机制一般分为以下几个步骤: 处理 HTML 并构建 DOM 树 处理 CSS 构建 CSSOM 树 将 DOM 树与 CSSOM 树合并成一个渲染树 根据渲染树来布局,计算每个节点的位置 调用 GPU 绘制,合成图层,显示在屏幕上 在构建 CSSOM 树时,会阻塞渲染,直到 CSSOM 树构建完成。并且构建 CSSOM 树是一个十分消耗性能的过程,所以应该尽量保证层级扁平,减少过度层叠,越是具体的 CSS 选择器,执行速度越慢 当 HTML 解析到 script 标签时,会暂停构建 DOM,完成后才会从暂停的地方重新开始。也就是说,如果你想首屏渲染的越快,
Updated: