home.wxml 919 B

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