fix
This commit is contained in:
parent
070f928d88
commit
505bf5f3ff
@ -17,7 +17,7 @@ struct DateNavView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center) {
|
||||
ForEach(navModel.dateModels, id: \.year) { model in
|
||||
ForEach(navModel.dateModels) { model in
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text(model.year)
|
||||
HStack {
|
||||
@ -35,6 +35,9 @@ struct DateNavView: View {
|
||||
.task {
|
||||
await self.navModel.loadDateCells()
|
||||
}
|
||||
.onAppear {
|
||||
print("group_id is: \(selectGroupId)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -90,15 +93,21 @@ extension DateNavView {
|
||||
@Observable
|
||||
final class DateNavModel {
|
||||
|
||||
struct DateModel: Codable {
|
||||
struct DateModel: Codable, Identifiable {
|
||||
struct Month: Codable {
|
||||
let id: String
|
||||
let name: String
|
||||
let disabled: Bool
|
||||
}
|
||||
|
||||
let id = UUID().uuidString
|
||||
let year: String
|
||||
let months: [Month]
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case year
|
||||
case months
|
||||
}
|
||||
}
|
||||
|
||||
var dateModels: [DateModel]
|
||||
|
||||
@ -154,8 +154,9 @@ struct IndexView: View {
|
||||
case .group(let group):
|
||||
Text(group.groupName)
|
||||
.onTapGesture {
|
||||
showDateNavPopover = true
|
||||
selectGroupId = group.groupId
|
||||
print("current group_id: \(self.selectGroupId)")
|
||||
showDateNavPopover = true
|
||||
}
|
||||
case .item(let item):
|
||||
VStack(alignment: .center) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user