Grails 在另一个自定义标记库中动态调用自定义标记库
我已经制作了两个自定义标记库,即tabContainer和tabGrails 在另一个自定义标记库中动态调用自定义标记库,grails,dynamic,gsp,taglib,Grails,Dynamic,Gsp,Taglib,我已经制作了两个自定义标记库,即tabContainer和tab def tabContainer = { attrs, body -> println("body: "+body()) out << '<div class="tab-content">' << body() << '</div>' } def tabContainer={attrs,body-> println(“body:+body()) o
def tabContainer = { attrs, body ->
println("body: "+body())
out << '<div class="tab-content">' << body() << '</div>'
}
def tabContainer={attrs,body->
println(“body:+body())
out像这样更改您的标签。这对我有用
out << '<div class="tab-pane ' + (attrs.active == "true" ? 'active' : '') + '" id="' + attrs.id + '">' << body() << '</div>'
out
<myUI:tabContainer>
<myUI:tab id="hello1">Hello1 contents</myUI:tab>
<myUI:tab id="hello2" active="true">Hello2 contents</myUI:tab>
</myUI:tabContainer>
out << '<div class="tab-pane ' + (attrs.active == "true" ? 'active' : '') + '" id="' + attrs.id + '">' << body() << '</div>'