message.swift 481 B

1234567891011121314151617181920212223
  1. //
  2. // message.swift
  3. // 74 桌
  4. //
  5. // Created by yunli on 2023/5/20.
  6. //
  7. import SwiftUI
  8. struct messageView: View {
  9. @Binding var count: Int
  10. var body: some View {
  11. List {
  12. ForEach(0 ..< count, id: \.self) { item in
  13. Text("\(item)")
  14. }
  15. Button(action: { count += 1; print(count) }) {
  16. Label("添加消息", systemImage: "plus")
  17. }
  18. }
  19. .navigationBarTitle("消息列表")
  20. }
  21. }