mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// SidebarItem.swift
|
||||
// ClashX Dashboard
|
||||
//
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import SwiftUI
|
||||
|
||||
|
||||
class SidebarItems: ObservableObject, Identifiable {
|
||||
let id = UUID()
|
||||
@Published var items: [SidebarItem]
|
||||
@Published var selectedIndex = 0
|
||||
|
||||
init(_ items: [SidebarItem]) {
|
||||
self.items = items
|
||||
}
|
||||
}
|
||||
|
||||
class SidebarItem: ObservableObject {
|
||||
let id = UUID()
|
||||
let name: String
|
||||
let icon: String
|
||||
let view: AnyView
|
||||
|
||||
|
||||
init(name: String, icon: String, view: AnyView) {
|
||||
self.name = name
|
||||
self.icon = icon
|
||||
self.view = view
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user