index.wxml 1.0 KB

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