Михаил Капелько 10 个月前
父节点
当前提交
27fb18c484
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. +5
    -4
      Modules/MeetupIdX/src/MeetupId.TV.swift
  2. +1
    -1
      Modules/MeetupIdX/src/MeetupId.TVM.swift

+ 5
- 4
Modules/MeetupIdX/src/MeetupId.TV.swift 查看文件

@@ -4,22 +4,23 @@ import SwiftUI
extension MeetupId {
public struct TV: View {
let id: String
@StateObject var vm = VM()
@StateObject var textField = BusUI.ManyTextField(K.testTextApp, K.testTextUI)
//@StateObject var vm = VM()
public init(_ id: String) {
self.id = id
}
public var body: some View {
TextField("TV", value: $vm.textField.v, formatter: BusUI.TextFieldSource())
TextField("TV", value: $textField.v, formatter: BusUI.TextFieldSource())
.padding(8)
.border(Color.blue)
.animation(.easeInOut(duration: 0.3))
.onAppear {
vm.setup(id)
textField.id = id
}
.onChange(of: id) { newValue in
vm.setup(newValue)
textField.id = newValue
}
}



+ 1
- 1
Modules/MeetupIdX/src/MeetupId.TVM.swift 查看文件

@@ -4,7 +4,7 @@ import Combine
extension MeetupId {
public final class VM: ObservableObject {
@Published public var id: String?
@Published var textField = BusUI.ManyTextField(K.testTextApp, K.testTextUI)
var textField = BusUI.ManyTextField(K.testTextApp, K.testTextUI)
var subscriptions = [AnyCancellable]()

public init() { }


正在加载...
取消
保存