Merge pull request #759 from trheyi/main
fix sui dynamic components import bug
This commit is contained in:
commit
dc43296763
2 changed files with 9 additions and 0 deletions
|
|
@ -284,6 +284,14 @@ func (page *Page) parseDynamics(ctx *BuildContext, sel *goquery.Selection) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.addJitComponent(route)
|
ctx.addJitComponent(route)
|
||||||
|
|
||||||
|
// This is a temprary solution, we will refactor this later
|
||||||
|
// Some components are not used in the page, but they are used in the script
|
||||||
|
// So we need to add them to the components
|
||||||
|
// But this solution is not perfect, it will cause import the unnecessary components, just ignore it.
|
||||||
|
// Add to the imports
|
||||||
|
name := fmt.Sprintf("comp_%s", strings.ReplaceAll(route, "/", "_"))
|
||||||
|
ctx.components[name] = route
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -901,6 +901,7 @@ func (parser *TemplateParser) show(sel *goquery.Selection) {
|
||||||
// sel.SetAttr("style", style)
|
// sel.SetAttr("style", style)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tidy the template by removing the parsed attributes
|
||||||
func (parser *TemplateParser) Tidy(s *goquery.Selection) {
|
func (parser *TemplateParser) Tidy(s *goquery.Selection) {
|
||||||
|
|
||||||
s.Contents().Each(func(i int, child *goquery.Selection) {
|
s.Contents().Each(func(i int, child *goquery.Selection) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue