index.wxml 1.1 KB

123456789101112131415161718192021222324252627
  1. <!-- index.wxml -->
  2. <view class="container">
  3. <!-- 引入组件 -->
  4. <import src="/component/group/group.wxml" />
  5. <import src="/component/hot/hot.wxml" />
  6. <import src="/component/follow/follow.wxml" />
  7. <import src="/component/my/my.wxml" />
  8. <!-- 调用组件 -->
  9. <template is="{{templates}}" data="{{groupData: groupData, hotData: hotData, followData: followData, myData: myData}}"></template>
  10. <!-- 顶部导航 -->
  11. <view class="top-tab">
  12. <block wx:for="{{tab}}" wx:key="{{index}}">
  13. <view class="tabbar {{index == myIndex ? 'select':' '}}" bindtap="switcher" data-index="{{index}}">
  14. <text>{{item.name}}</text>
  15. </view>
  16. </block>
  17. </view>
  18. <!-- <view class="template" wx:if="{{templates == 'hot'}}">
  19. <template is="{{templates}}" data="{{...hotData}}"></template>
  20. </view>
  21. <view class="template" wx:elif="{{templates == 'follow'}}">
  22. <template is="{{templates}}" data="{{followData: followData}}"></template>
  23. </view>
  24. <view class="template" wx:else="{{templates == 'my'}}">
  25. <template is="{{templates}}" data="{{myData: myData}}"></template>
  26. </view> -->
  27. </view>