38 lines
1.0 KiB
Swift
38 lines
1.0 KiB
Swift
//
|
|
// TaBarView.swift
|
|
// IOS_study
|
|
//
|
|
// Created by CC-star on 2025/6/29.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct TaBarView: View {
|
|
@Environment(TabBarViewModel.self) var vm
|
|
@State var authVM = AuthViewModel()
|
|
@State var plJobVM1 = PLJobViewModel()
|
|
@State var plJobVM4 = PLJobViewModel()
|
|
@State var plJobVM5 = PLJobViewModel()
|
|
var body: some View {
|
|
@Bindable var vm = vm
|
|
TabView(selection: $vm.selectedTab) {
|
|
Tab("工作", systemImage: "yensign.circle", value: "job") {
|
|
PLJobsView().toolbarBackground(.visible, for: .tabBar)
|
|
.environment(plJobVM1)
|
|
}
|
|
Tab("雇佣", systemImage: "plus.circle", value: "postJob") {
|
|
PostJobView().toolbarBackground(.visible, for: .tabBar)
|
|
.environment(plJobVM4)
|
|
}
|
|
Tab("我的", systemImage: "person.circle", value: "profile") {
|
|
ProfileView().toolbarBackground(.visible, for: .tabBar)
|
|
.environment(plJobVM5)
|
|
}
|
|
}.environment(authVM)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
TaBarView()
|
|
}
|