Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update updating-arrays-in-state.md #1622

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/learn/updating-arrays-in-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ button { margin: 5px; }

#### 删除购物车中的商品 {/*remove-an-item-from-the-shopping-cart*/}

现在购物车有了一个正常工作的“+”按钮,但是“-”按钮却没有任何作用。你需要为它添加一个事件处理程序,以便按下它时可以减少对应商品的 `count`。如果在数字为 1 时按下按钮,商品需要自动从购物车中移除。确保商品计数永远不出现 0。
现在购物车有了一个正常工作的“+”按钮,但是“-”按钮却没有任何作用。你需要为它添加一个事件处理程序,以便按下它时可以减少对应商品的 `count`。如果在数字为 1 时按下“-”按钮,商品需要自动从购物车中移除。确保商品计数永远不出现 0。

<Sandpack>

Expand Down
Loading