Skip to content

Commit

Permalink
format Alert code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu-hongwei committed Jul 15, 2023
1 parent 2f63448 commit 8797146
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/alerts-and-menus/demo3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
基本的SwiftUI警报如下所示:

```swift
Alert(title: Text("Important message"), message: Text("Wear sunscreen"), dismissButton: .default(Text("Got it!")))
Alert(
title: Text("Important message"),
message: Text("Wear sunscreen"),
dismissButton: .default(Text("Got it!"))
)
```

但是,您经常需要将动作附加到按钮上,以便在点击它们时执行特定的动作。 为此,请在您的按钮上附加一个闭包,当您点击按钮时将其关闭,如下所示:
Expand Down

0 comments on commit 8797146

Please sign in to comment.