diff --git a/src/assets/images/IMG-20250104114722956.png b/src/assets/images/images/IMG-20250104114722956.png similarity index 100% rename from src/assets/images/IMG-20250104114722956.png rename to src/assets/images/images/IMG-20250104114722956.png diff --git a/src/assets/images/images/IMG-3D020E6C18045F751BC938C45EC88E95.png b/src/assets/images/images/IMG-3D020E6C18045F751BC938C45EC88E95.png new file mode 100644 index 0000000..9274c44 Binary files /dev/null and b/src/assets/images/images/IMG-3D020E6C18045F751BC938C45EC88E95.png differ diff --git a/src/assets/images/images/IMG-5D773F6926C2C236AC8FF3150AE233AD.png b/src/assets/images/images/IMG-5D773F6926C2C236AC8FF3150AE233AD.png new file mode 100644 index 0000000..a6ce35f Binary files /dev/null and b/src/assets/images/images/IMG-5D773F6926C2C236AC8FF3150AE233AD.png differ diff --git a/src/content/note/如何在 cursor 中使用 deepseek-coder.md b/src/content/note/如何在 cursor 中使用 deepseek-coder.md index 482add9..c263006 100644 --- a/src/content/note/如何在 cursor 中使用 deepseek-coder.md +++ b/src/content/note/如何在 cursor 中使用 deepseek-coder.md @@ -1,5 +1,5 @@ --- -title: 如何在 Cursor 中使用 DeepSeek-Coder +title: 如何在 cursor 中使用 deepseek-coder date: 2024-07-25T00:00:00.000Z author: KazooTTT type: Post @@ -18,7 +18,7 @@ link-notionnext: >- https://kazoottt.notion.site/cursor-deepseek-coder-f759bbe6aa4b4317969544927430146b toAstro: true date_created: 2025-01-04T03:44:53.000Z -date_modified: 2025-02-07T03:17:03.000Z +date_modified: 2025-02-12T02:52:44.000Z --- # 如何在 cursor 中使用 deepseek-coder diff --git a/src/content/note/碎片-2025-02-14 15时00分 状态没变更?记录一次没阻止冒泡导致的bug.md b/src/content/note/碎片-2025-02-14 15时00分 状态没变更?记录一次没阻止冒泡导致的bug.md new file mode 100644 index 0000000..6abc7fd --- /dev/null +++ b/src/content/note/碎片-2025-02-14 15时00分 状态没变更?记录一次没阻止冒泡导致的bug.md @@ -0,0 +1,42 @@ +--- +title: 碎片-2025-02-14 15时00分 状态没变更?记录一次没阻止冒泡导致的bug +date: 2025-02-14T00:00:00.000Z +author: KazooTTT +tags: + - 前端 +description: 基础不牢,地动山摇 +slug: fragmented-notes-2025-02-14-15-00-49 +published: true +toAstro: true +astroType: null +category: 前端 +date_created: 2025-02-14T07:10:55.000Z +date_modified: 2025-02-14T07:18:42.000Z +excalidrawFile: '[[记录一次没阻止冒泡导致的bug.excalidraw]]' +--- + +举个例子: + +![IMG-3D020E6C18045F751BC938C45EC88E95](../../assets/images/IMG-3D020E6C18045F751BC938C45EC88E95.png) + +- 预期:删除了当前激活的item之后,list中第一个item被激活。 +- 错误的现象:删除了当前激活的item之后,无任何item被激活。 + +由于我点击删除按钮的时候,没有阻止冒泡,而删除的按钮的父组件是item,它们都有绑定click事件。 + +所以调用的步骤就是: + +1. 首先调用删除item的回调,并且由于我的激活index就是目标要删除的index,所以是期望设置activeIndex = 2 +2. 但是由于没有阻止冒泡,所以在设置了activeIndex = 2之后,又去调用了activeIndex = 1 +3. 最后导致看起来状态没有发生变化这样的bug + +![IMG-5D773F6926C2C236AC8FF3150AE233AD](../../assets/images/IMG-5D773F6926C2C236AC8FF3150AE233AD.png) + +最后的解决方法是:在删除item的回调中,阻止冒泡。 + +```tsx +onClick = (e)=>{ + e.stopPropagation() + deleteItemByIndex(index) +} +``` diff --git a/src/content/post/不引入astro wiki plugin实现链接跳转的思路.md b/src/content/post/不引入astro wiki plugin实现链接跳转的思路.md index a218c71..45c0933 100644 --- a/src/content/post/不引入astro wiki plugin实现链接跳转的思路.md +++ b/src/content/post/不引入astro wiki plugin实现链接跳转的思路.md @@ -1,6 +1,6 @@ --- date_created: 2025-02-09T08:34:48.000Z -date_modified: 2025-02-10T03:08:27.000Z +date_modified: 2025-02-13T10:39:35.000Z title: 不引入astro wiki plugin实现链接跳转的思路 date: 2025-02-09T00:00:00.000Z author: KazooTTT @@ -21,6 +21,7 @@ description: >- 作为唯一标识,从而实现正确的链接跳转。 toAstro: true astroType: post +excalidrawFile: '[[不引入astro wiki plugin实现链接跳转的思路.excalidraw]]' --- ## 背景