我的应用程序中的新 NavigationLink 出现问题,当我单击按钮时,更改页面但立即返回。我哪里错了?
NavigationLink(destination: TeamsModuleView(), tag: t.id, selection: self.$selection) {
Button(action: {
self.selection = t.id //Is dynamic
self.settings.fixtureId = t.fixtureId
self.settings.teamHomeId = t.teams.teamHomeId
self.settings.teamAwayId = t.teams.teamAwayId
self.settings.teamHome = t.teams.teamHome
self.settings.teamAway = t.teams.teamAway
}) {
HStack {
Text("Go")
.foregroundColor(Color.white)
}
.frame(minWidth: 0, maxWidth: .infinity)
.padding(20)
.background(Color.init(red: 0.80, green: 0.16, blue: 0.24))
.cornerRadius(7)
}
.padding([.leading, .trailing], 30)
}