home.wxml 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <!--pages/home/home.wxml-->
  2. <view>
  3. <!-- 跳转非tabbar页 类似于a标签 -->
  4. <navigator url="/pages/detail/detail">去列表</navigator>
  5. <!-- tap click -->
  6. <text class="title" bind:tap="showHi">首页</text>
  7. <!-- 模版渲染 -->
  8. <view>今天是{{day}}</view>
  9. <!-- 条件渲染 -->
  10. <!-- v-if v-else-if v-else -->
  11. <view wx:if="{{score >= 90}}">优秀</view>
  12. <view wx:elif="{{score > 60}}">及格</view>
  13. <view wx:else="{{score < 60}}">不及格</view>
  14. <!-- @click v-bind:click -->
  15. <button class="main" catch:tap='showHello'>你好</button>
  16. <!-- bindconfirm bindtap bindInput -->
  17. <input type="text" bindinput="handleInp" />
  18. <view class="box1" bind:tap="showMain1">
  19. <view class="box2" catch:tap="showMain2"></view>
  20. </view>
  21. <template name="hi">
  22. <text>hello,今天星期日</text>
  23. <view>成绩:{{score}}</view>
  24. <!-- 循环渲染 -->
  25. <view wx:for="{{list}}" wx:for-item="item" wx:key="index">
  26. {{item.id}}--{{item.name}}
  27. {{item}}
  28. </view>
  29. </template>
  30. </view>