From 58534f532fc8721d9c5037fae30d17302a340012 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 18 Jul 2024 19:13:22 +0800 Subject: [PATCH] Refactor copySlots method to use slot.Contents() instead of slot.Children() --- sui/core/build.go | 2 +- sui/core/jit.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sui/core/build.go b/sui/core/build.go index 2cf25df0..cf14b90c 100644 --- a/sui/core/build.go +++ b/sui/core/build.go @@ -242,7 +242,7 @@ func (page *Page) copySlots(from *goquery.Selection, to *goquery.Selection) erro continue } - slotSel.ReplaceWithSelection(slot.Children()) + slotSel.ReplaceWithSelection(slot.Contents()) } return nil diff --git a/sui/core/jit.go b/sui/core/jit.go index a91bc397..fa9f85e8 100644 --- a/sui/core/jit.go +++ b/sui/core/jit.go @@ -99,7 +99,7 @@ func (parser *TemplateParser) RenderComponent(comp *JitComponent, props map[stri } // Replace the slot - slotSel.ReplaceWithNodes(s.Contents().Nodes...) + slotSel.ReplaceWithSelection(s.Contents()) }) option := *parser.option