File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ struct ContentView : View {
97
97
NavigationLink ( destination: SectionPage ( ) ) {
98
98
PageRow ( title: " Section " , subTitle: " 用于创建带头/尾部的视图内容,一般结合 `List` 组件使用 " )
99
99
} . frame ( height: 80 )
100
+ NavigationLink ( destination: FormPage ( firstName: " " , lastName: " " ) ) {
101
+ PageRow ( title: " Form " , subTitle: " 表单视图 " )
102
+ }
100
103
}
101
104
Section ( header: Text ( " 导航视图 " ) ) {
102
105
NavigationLink ( destination: NavigationViewPage ( ) ) {
Original file line number Diff line number Diff line change
1
+ //
2
+ // FormPage.swift
3
+ // Example
4
+ //
5
+ // Created by Chasel Li on 12/26/19.
6
+ // Copyright © 2019 晋先森. All rights reserved.
7
+ //
8
+
9
+ import SwiftUI
10
+
11
+ struct FormPage : View {
12
+
13
+ @State var firstName : String
14
+ @State var lastName : String
15
+
16
+ var body : some View {
17
+ VStack {
18
+ Form {
19
+ TextField ( " First Name " , text: $firstName)
20
+ TextField ( " Last Name " , text: $lastName)
21
+ }
22
+ } . navigationBarTitle ( Text ( " Form " ) )
23
+
24
+ }
25
+ }
26
+
27
+ struct FormPage_Previews : PreviewProvider {
28
+ static var previews : some View {
29
+ FormPage ( firstName: " " , lastName: " " )
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments