From 8027a615b9c6e8b7f73ac6152948982aeb8551f5 Mon Sep 17 00:00:00 2001 From: likaiye Date: Thu, 16 Jul 2026 13:05:58 +0800 Subject: [PATCH] update: support multi tabs in one page --- template/components/tabs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/template/components/tabs.go b/template/components/tabs.go index 170b019b8..49f83a16e 100644 --- a/template/components/tabs.go +++ b/template/components/tabs.go @@ -4,10 +4,12 @@ import ( "html/template" "github.com/GoAdminGroup/go-admin/template/types" + "github.com/google/uuid" ) type TabsAttribute struct { Name string + Id string Data []map[string]template.HTML types.Attribute } @@ -18,5 +20,8 @@ func (compo *TabsAttribute) SetData(value []map[string]template.HTML) types.Tabs } func (compo *TabsAttribute) GetContent() template.HTML { + if compo.Id == "" { + compo.Id = uuid.New().String()[:8] + } return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tabs") }