This commit is contained in:
anlicheng 2025-02-21 21:46:10 +08:00
parent a16a416642
commit a50a4dc4f0

View File

@ -72,10 +72,12 @@ final class IndexModel {
var dramas: [DramaItem]
var showUpdateDramas: [UpdateDramaShowItem]
var selectedDate: String
init() {
self.dramas = []
self.showUpdateDramas = []
self.selectedDate = ""
}
@MainActor
@ -156,6 +158,7 @@ struct IndexView: View {
.onTapGesture {
selectGroupId = group.groupId
print("current group_id: \(self.selectGroupId)")
indexModel.selectedDate = group.groupId
showDateNavPopover = true
}
case .item(let item):
@ -180,6 +183,9 @@ struct IndexView: View {
}
}
}
.onChange(of: indexModel.selectedDate) { oldValue, newValue in
print("old date: \(oldValue), new value: \(newValue)")
}
Rectangle()
.frame(height: 0)