forked from GoAdminGroup/go-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tree.go
43 lines (35 loc) · 939 Bytes
/
tree.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package components
import (
"github.com/chenhg5/go-admin/modules/menu"
"github.com/chenhg5/go-admin/template/types"
"html/template"
)
type TreeAttribute struct {
Name string
Tree []menu.MenuItem
EditUrl string
DeleteUrl string
OrderUrl string
}
func (compo *TreeAttribute) SetTree(value []menu.MenuItem) types.TreeAttribute {
compo.Tree = value
return compo
}
func (compo *TreeAttribute) SetEditUrl(value string) types.TreeAttribute {
compo.EditUrl = value
return compo
}
func (compo *TreeAttribute) SetDeleteUrl(value string) types.TreeAttribute {
compo.DeleteUrl = value
return compo
}
func (compo *TreeAttribute) SetOrderUrl(value string) types.TreeAttribute {
compo.OrderUrl = value
return compo
}
func (compo *TreeAttribute) GetContent() template.HTML {
return ComposeHtml(*compo, "tree")
}
func (compo *TreeAttribute) GetTreeHeader() template.HTML {
return ComposeHtml(*compo, "tree-header")
}