< template name = "navbar" > < view id = "navbar" > < text class = "item {{currentTab==index ? 'active' : ''}}" wx:for = "{{navbar}}" wx:key = "{{index}}" data-index = "{{index}}" bindtap = "onNavbarTap" > {{item}} </ text > </ view > </ template > |
< template is = "navbar" data = "{{navbar}}" ></ template > |
还需要传递一个currentTab
<
template
is
=
"navbar"
data
=
"{{navbar,currentTab}}"
></
template
>