mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-24 10:56:36 +08:00
优化界面
This commit is contained in:
@@ -2,38 +2,49 @@ package actionutils
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type TabItem struct {
|
||||
Name string `json:"name"`
|
||||
SubName string `json:"subName"`
|
||||
URL string `json:"url"`
|
||||
Icon string `json:"icon"`
|
||||
IsActive bool `json:"isActive"`
|
||||
IsRight bool `json:"isRight"`
|
||||
IsTitle bool `json:"isTitle"`
|
||||
IsDisabled bool `json:"isDisabled"`
|
||||
}
|
||||
|
||||
// Tabbar Tabbar定义
|
||||
type Tabbar struct {
|
||||
items []maps.Map
|
||||
items []*TabItem
|
||||
}
|
||||
|
||||
// NewTabbar 获取新对象
|
||||
func NewTabbar() *Tabbar {
|
||||
return &Tabbar{
|
||||
items: []maps.Map{},
|
||||
items: []*TabItem{},
|
||||
}
|
||||
}
|
||||
|
||||
// Add 添加菜单项
|
||||
func (this *Tabbar) Add(name string, subName string, url string, icon string, active bool) maps.Map {
|
||||
m := maps.Map{
|
||||
"name": name,
|
||||
"subName": subName,
|
||||
"url": url,
|
||||
"icon": icon,
|
||||
"active": active,
|
||||
"right": false,
|
||||
"isTitle": false,
|
||||
func (this *Tabbar) Add(name string, subName string, url string, icon string, active bool) *TabItem {
|
||||
var m = &TabItem{
|
||||
Name: name,
|
||||
SubName: subName,
|
||||
URL: url,
|
||||
Icon: icon,
|
||||
IsActive: active,
|
||||
IsRight: false,
|
||||
IsTitle: false,
|
||||
IsDisabled: false,
|
||||
}
|
||||
this.items = append(this.items, m)
|
||||
return m
|
||||
}
|
||||
|
||||
// Items 取得所有的Items
|
||||
func (this *Tabbar) Items() []maps.Map {
|
||||
func (this *Tabbar) Items() []*TabItem {
|
||||
return this.items
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user