05 2025 档案

摘要:It can be a performance bottleneck if you frequently add/remove event listener bind to a DOM element. patchProps(el, key, prevValue, nextValue) { if ( 阅读全文
posted @ 2025-05-29 15:15 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要:Brwoser support: https://caniuse.com/?search=%3Ahas <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="widt 阅读全文
posted @ 2025-05-27 19:43 Zhentiw 阅读(11) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=clamp <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="wid 阅读全文
posted @ 2025-05-27 19:38 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/css-text-wrap-balance <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" cont 阅读全文
posted @ 2025-05-27 19:35 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要:可扩展性是指系统、程序或技术架构在功能、规模及性能需求增加时,能够容易地增加其性能、容量和功能的能力。 示例 假设我们有一个国际化网站,我们希望根据用户选择的语言动态显示不同的内容,比如在网站首页展示一个欢迎语,不考虑扩展性,可能的实现方式如下: <!--Vue实现示例--> <template> 阅读全文
posted @ 2025-05-27 14:20 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/css-container-queries <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" cont 阅读全文
posted @ 2025-05-26 13:41 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=Dynamic%20viewport%20units Dynamic viewport mainly resolve the issue of mobile web, due to mobile has flo 阅读全文
posted @ 2025-05-26 13:39 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=aspect-ratio <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" conte 阅读全文
posted @ 2025-05-26 13:24 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要:Brwoser support: https://caniuse.com/?search=Logical%20Properties%20 We want to achieve following effect, the first box, we applied writing-mode: vert 阅读全文
posted @ 2025-05-25 19:23 Zhentiw 阅读(11) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=writing <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="w 阅读全文
posted @ 2025-05-25 19:14 Zhentiw 阅读(27) 评论(0) 推荐(0)
摘要:Brwoser support: https://caniuse.com/?search=width%3Amin-content https://caniuse.com/?search=width%3Amax-content <!DOCTYPE html> <html lang="en"> <hea 阅读全文
posted @ 2025-05-25 19:09 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=subgrid <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="w 阅读全文
posted @ 2025-05-25 18:57 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=scrollbar-gutter When a element has limited size, and the content is oversized, the scrolling bar will sh 阅读全文
posted @ 2025-05-25 18:48 Zhentiw 阅读(54) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=%40media Normally we write midea query like this: @media (max-width: 750px) { div { color: red; } } It ap 阅读全文
posted @ 2025-05-25 18:43 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=layer As we know by defualt, class selector has a higher priority than element selector in CSS <!DOCTYPE 阅读全文
posted @ 2025-05-25 18:38 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要:因为有一些属性,在HTML标签上的名字和DOM Properties API中的名字是不一致的,比如最常用的,标签上的class属性,DOM Properties中是className 另外,并不是所有 HTML Attributes 都有与之对应的 DOM Properties,例如: <div 阅读全文
posted @ 2025-05-24 17:57 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要:竞态问题通常在多线程编程中被提及。 多线程中的竞态问题(Race Condition)是指多个线程或进程在并发执行时,由于对共享资源(如变量、内存、文件等)的访问和修改顺序不确定,导致程序行为不可预测的问题。 竞态问题的关键点在于: 共享资源:多个线程同时访问并修改同一个资源,如全局变量或内存位置。 阅读全文
posted @ 2025-05-18 18:57 Zhentiw 阅读(74) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=animation-timeline <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" 阅读全文
posted @ 2025-05-13 01:13 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=%40property Normal CSS variable doesn't support gradient animation <!DOCTYPE html> <html lang="en"> <head 阅读全文
posted @ 2025-05-13 01:09 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=anchor%20positioning <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewpor 阅读全文
posted @ 2025-05-11 15:13 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=%40scope Example 1: global @scope () <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <me 阅读全文
posted @ 2025-05-11 15:11 Zhentiw 阅读(14) 评论(0) 推荐(0)
摘要:Browser support: https://caniuse.com/?search=css%20nesting Example 1: <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content=" 阅读全文
posted @ 2025-05-11 15:02 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要:// 内置工具类型 // 1. Partial<T>:将类型 T 的所有属性变为可选属性。 // 2. Required<T>:将类型 T 的所有可选属性变为必需属性。 // 3. Readonly<T>:将类型 T 的所有属性变为只读属性。 // 4. Record<K, T>:将类型 K 的所有 阅读全文
posted @ 2025-05-11 14:53 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要:开发中的那些规范 为什么需要规范 现在开发一个应用基本上都是多人协作,一旦涉及到多人,必然不同的开发者的开发习惯、编码方式都是有所不同的,如果没有一个统一的规范,就会造成非常多的问题: 代码风格不一 目录杂乱无章 接口不统一(偏后端),例如: 修改用户定的接口为 /v1/users 修改密钥的接口: 阅读全文
posted @ 2025-05-08 13:42 Zhentiw 阅读(72) 评论(0) 推荐(0)
摘要:Sometime the element width is dynmiac, and you want to use the width in css, how to do that 1. Define css variable in css file, --wis the container's 阅读全文
posted @ 2025-05-06 14:17 Zhentiw 阅读(9) 评论(0) 推荐(0)
摘要:By default, git ignorecase for filename. It might happen that you change the filename from Modal.vueto modal.vue, then commit to git, in remote repo, 阅读全文
posted @ 2025-05-06 14:10 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要:type Watcher<T> = { on<K extends keyof T & string>( eventName: `${K}Changed`, callback: (oldValue: T[K], newValue: T[K]) => void ): void; }; declare f 阅读全文
posted @ 2025-05-06 14:06 Zhentiw 阅读(7) 评论(0) 推荐(0)