<include src="../templates/header/header"/>
<button type="default" bindtap="btnClick" >{{btnName}} </button>
<text class="row">{{text}}</text>
<text>判断标签:</text>
<text class="row" wx:if="{{true}}">条件判断:true显示</text>
<text class="row" wx:if="{{false}}">条件判断:false隐藏</text>
<text class="row" wx:if="{{show}}">js条件绑定:true显示,false隐藏</text>
<text class="row" wx:if="{{isShow}}">js点击事件控制:显示隐藏</text>
<!-- 判断标签: 如果为真,显示按钮1;如果为假,显示按钮2 -->
<text class="row" wx:if="{{show}}">{{name}} 1 </text>
<text class="row" wx:else>{{name}} 2 </text>
<!-- 循环标签 -->
<text>循环标签:</text>
<view class="box">
<view wx:for="{{news}}">{{item}}</view>
</view>
<view class="box">
<view wx:for="{{news}}" wx:for-item="itemx">
{{index+1}}-{{itemx}}
</view>
</view>
<!-- 事件类别 -->
<text>事件类型:</text>
<view class="box">
<text class="p">点击事件:tap</text>
<text class="p">长按事件:longtap</text>
<text class="p">触摸事件:touchstart touchend touchmove touchcancel</text>
<text class="p">其他:submit input</text>
</view>
<!-- 事件绑定-->
<text>事件绑定方式:</text>
<view class="box">
<text class="p">bind绑定:触发冒泡事件</text>
<text class="p">catch绑定:阻止冒泡事件</text>
</view>
<!-- 事件的对象-->
<text>事件的对象:</text>
<view class="box">
<text class="p">事件类型:type</text>
<text class="p">时间戳:timeStamp</text>
<text class="p">事件源组件:target</text>
<text class="p">当前组件:currentTarget</text>
<text class="p">触摸点数:touches</text>
</view>
<!-- 循环标签 -->
<text>模板:两种导入方式</text>
<import src="../templates/footer/footer"/>
<template is="footer1" data="{{text:'我是页脚的动态数据'}}"/>
小程序1:判断标签、循环标签、事件类别、事件绑定方式
最新推荐文章于 2024-01-04 09:42:21 发布