Skip to content

Commit 2ffc720

Browse files
committed
调整位置
1 parent efa73fe commit 2ffc720

File tree

16 files changed

+80
-36
lines changed

16 files changed

+80
-36
lines changed

.vitepress/config.mts

Lines changed: 64 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default defineConfig({
6868
items: [
6969
{ text: "grammar", link: "/javascript/grammar/introduction" },
7070
{ text: "application", link: "/javascript/application/firstFrame" },
71+
{ text: "Web api", link: "/javascript/Web-Api/ResizeObserver" },
7172
{ text: "算法", link: "/javascript/algorithm" },
7273
{ text: "手写题", link: "/javascript/handlecode" },
7374
],
@@ -80,7 +81,7 @@ export default defineConfig({
8081
{ text: "React", link: "/frame/react/start" },
8182
],
8283
},
83-
{ text: "Web-Api", link: "/Web-Api/ResizeObserver" },
84+
// { text: "Web-Api", link: "/Web-Api/ResizeObserver" },
8485
{ text: "pnpm", link: "/pnpm/overview" },
8586
{ text: "vscode", link: "/vscode/extension" },
8687
{
@@ -209,6 +210,34 @@ export default defineConfig({
209210
link: "/javascript/algorithm",
210211
},
211212
],
213+
"/javascript/Web-Api": [
214+
{ text: "ResizeObserver", link: "/javascript/Web-Api/ResizeObserver" },
215+
{ text: "XMLHttpRequest", link: "/javascript/Web-Api/XMLHttpRequest" },
216+
{ text: "Web Storage API", link: "/javascript/Web-Api/StorageAPI" },
217+
{ text: "高亮API", link: "/javascript/Web-Api/Highlight" },
218+
{ text: "同源通信", link: "/javascript/Web-Api/sameOrigin" },
219+
{ text: "CSS 对象模型(CSSOM)", link: "/javascript/Web-Api/cssom" },
220+
{ text: "File API", link: "/javascript/Web-Api/file" },
221+
{ text: "Canvas", link: "/javascript/Web-Api/canvas" },
222+
{ text: "拖拽API", link: "/javascript/Web-Api/dragAnddrop" },
223+
{ text: "History API", link: "/javascript/Web-Api/history" },
224+
{
225+
text: "Intersection Observer API",
226+
link: "/Web-Api/intersection",
227+
},
228+
{
229+
text: "web work",
230+
link: "/Web-Api/webWork",
231+
},
232+
{
233+
text: "webAssembly",
234+
link: "/Web-Api/webAssembly",
235+
},
236+
{
237+
text: "service work",
238+
link: "/Web-Api/serviceWork",
239+
},
240+
],
212241
"/rust/": [
213242
{
214243
text: "开始",
@@ -261,40 +290,40 @@ export default defineConfig({
261290
link: "/frame/vue/apis",
262291
},
263292
],
264-
"/Web-Api/": [
265-
{
266-
text: "Web-Api",
267-
// collapsed: true,
268-
items: [
269-
{ text: "ResizeObserver", link: "/Web-Api/ResizeObserver" },
270-
{ text: "XMLHttpRequest", link: "/Web-Api/XMLHttpRequest" },
271-
{ text: "Web Storage API", link: "/Web-Api/StorageAPI" },
272-
{ text: "高亮API", link: "/Web-Api/Highlight" },
273-
{ text: "同源通信", link: "/Web-Api/sameOrigin" },
274-
{ text: "CSS 对象模型(CSSOM)", link: "/Web-Api/cssom" },
275-
{ text: "File API", link: "/Web-Api/file" },
276-
{ text: "Canvas", link: "/Web-Api/canvas" },
277-
{ text: "拖拽API", link: "/Web-Api/dragAnddrop" },
278-
{ text: "History API", link: "/Web-Api/history" },
279-
{
280-
text: "Intersection Observer API",
281-
link: "/Web-Api/intersection",
282-
},
283-
{
284-
text: "web work",
285-
link: "/Web-Api/webWork",
286-
},
287-
{
288-
text: "webAssembly",
289-
link: "/Web-Api/webAssembly",
290-
},
291-
{
292-
text: "service work",
293-
link: "/Web-Api/serviceWork",
294-
},
295-
],
296-
},
297-
],
293+
// "/Web-Api/": [
294+
// {
295+
// text: "Web-Api",
296+
// // collapsed: true,
297+
// items: [
298+
// { text: "ResizeObserver", link: "/Web-Api/ResizeObserver" },
299+
// { text: "XMLHttpRequest", link: "/Web-Api/XMLHttpRequest" },
300+
// { text: "Web Storage API", link: "/Web-Api/StorageAPI" },
301+
// { text: "高亮API", link: "/Web-Api/Highlight" },
302+
// { text: "同源通信", link: "/Web-Api/sameOrigin" },
303+
// { text: "CSS 对象模型(CSSOM)", link: "/Web-Api/cssom" },
304+
// { text: "File API", link: "/Web-Api/file" },
305+
// { text: "Canvas", link: "/Web-Api/canvas" },
306+
// { text: "拖拽API", link: "/Web-Api/dragAnddrop" },
307+
// { text: "History API", link: "/Web-Api/history" },
308+
// {
309+
// text: "Intersection Observer API",
310+
// link: "/Web-Api/intersection",
311+
// },
312+
// {
313+
// text: "web work",
314+
// link: "/Web-Api/webWork",
315+
// },
316+
// {
317+
// text: "webAssembly",
318+
// link: "/Web-Api/webAssembly",
319+
// },
320+
// {
321+
// text: "service work",
322+
// link: "/Web-Api/serviceWork",
323+
// },
324+
// ],
325+
// },
326+
// ],
298327
"/configure/": [
299328
{
300329
text: "项目配置",

frame/react/start.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,19 @@ function Profile() {
234234

235235
捕获事件对于路由或数据分析之类的代码很有用,但你可能不会在应用程序代码中使用它们。
236236

237-
这就相当监听元素的捕获事件
237+
这就相当监听元素的捕获事件
238+
239+
## react的事件处理
240+
不会在每一个元素上绑定事件。会把对应的函数添加到一个内部函数映射中,在页面的document上设置一个事件监听器。通过冒泡检查是否有对应的handler
241+
242+
合成事件:统一了浏览器的不一致性。包含传播工作必需的信息
243+
244+
但是创建的合成事件包装器会被垃圾回收。需要占用cpu。为此,react提供了一个合成事件实例池
245+
246+
::: tip
247+
unknown never
248+
any的类型安全替代物,操作前需要进行断言或者基于控制流的收缩
249+
250+
用于函数永远不会有返回值或到达其执行路径末端
251+
:::
252+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)