
2022
DyuanH
日常记录,不足之处还望往来大佬指点一二。
展开
-
position fixed 不是基于浏览器窗口的问题
文档里讲了:当元素祖先的 transform, perspective 或 filter 属性非 none 时,容器由视口改为该祖先。文档:https://developer.mozilla.org/zh-CN/docs/Web/CSS/position。原创 2022-12-02 15:14:08 · 514 阅读 · 0 评论 -
css伪类 :nth-child
标签>:nth-of-type(n) 该标签的位置属于父级的第n个儿子。:nth-child(n) 该标签的位置属于父级的第n个儿子。:first-child 该标签的位置属于父级的第1个儿子。原创 2022-11-03 11:23:51 · 189 阅读 · 0 评论 -
git 修改已提交 commit 的信息
git 修改最后一次提交 commit 的信息。原创 2022-09-02 14:27:46 · 168 阅读 · 0 评论 -
本地资源加载不了 file:// net::ERR_UNKNOWN_URL_SCHEME
file:// net::ERR_UNKNOWN_URL_SCHEME解决 开发环境使用tsFile://,生产环境使用file://原创 2022-06-23 14:38:06 · 586 阅读 · 0 评论 -
replaceAll is not a function
replaceAll 的Chrome可用版本是85查看当前Chrome版本原创 2022-06-22 10:01:17 · 2369 阅读 · 0 评论 -
字体子集化fontmin应用
const fm = require('fontmin')const f = './字体名称.ttf'const fontmin = new fm()fontmin.src(f) .use(fm.glyph({ text: '天地玄黄 宇宙洪荒' })) .use(fm.ttf2svg())// .dest('./public') //生成文件路径fontmin.run((err, files, stream) => { // 回调进行更多操作 console原创 2022-05-27 16:04:47 · 410 阅读 · 0 评论 -
图片 url blob base64 互转
待补充// url to blobexport const urlToBlob = async (url: string) => { return new Promise(resolve => { fetch(url).then(res => res.blob()).then(blob => { resolve(blob) }) })}// blob to base64export const blobToDataURI = (blob原创 2022-03-23 02:11:24 · 692 阅读 · 0 评论 -
关于节点元素dragenter dragleave频繁触发的问题
解决1、计数 dragenter和dragleave最终触发次数是相等的2、判断currentTarget和relatedTargetconst onDragenterProduct = (index: number, e: any) => { dragenterProductIndex.value = index}const onDragleaveProduct = (e: any) => { // 如果当前的节点不包含上个节点就是离开 if (!e.currentTar原创 2022-02-18 11:50:58 · 1898 阅读 · 0 评论 -
ondrop事件监听不到
解决: 添加dragover事件并阻止默认事件<div @dragover.prevent @drop="handleDrop" />原创 2022-02-09 13:36:56 · 668 阅读 · 0 评论 -
绝对定位的元素宽度自动撑开
position:absolute;white-space: nowrap;原创 2022-01-26 18:05:47 · 1207 阅读 · 0 评论 -
glDrawElements: Source and destination textures of the draw are the same.
pixi.js app.renderer.plugins.extract.image 导出报错 导致Graphics是黑的GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.原因不是很明白,好像是自己draw自己最后解决方案是不用app.renderer导出,重新new一个renderer用来导出,导出完再destroy。...原创 2022-01-25 11:24:56 · 325 阅读 · 0 评论 -
getBoundingClientRect offsetWidth offsetHeight
对于一个旋转的dom元素,getBoundingClientRect()得到的width,height是外接矩形的宽高,offsetWidth offsetHeight是未旋转前dom的宽高原创 2022-01-19 17:46:48 · 883 阅读 · 0 评论 -
pixi.js 导出部分区域裁剪图片
方案先通过api到出image对象,在通过canvas绘制图片,在导出数据代码const { x, y } = this.app.stage.getBounds() // 超出的x,yconst stageImage = this.app.renderer.plugins.extract.image(this.app.stage, "image/jpeg", 1)stageImage.onload = () => { const canvasElement = document.crea原创 2022-01-18 11:25:39 · 1828 阅读 · 0 评论