标签:ima export fun 界面 nav ext for 循环 哈哈 跳转
1. 数据的绑定以及样式和事件的绑定,和if else的使用
```
<view class="usermotto" bindtap=‘clickMe‘>
<text class="user-motto">{{motto}}</text>
<text wx:if="{{isShow}}">show</text>
<text wx:else>aaaa</text>
```
可以不用else
for 循环
```
<view wx:for="{{rund}}" wx:for-item="item" wx:key="idx">
<text>{{item}}</text>
</view>
```
3. 界面的跳转有返回键的. 
```
onTap:function(){
wx:navigateTo({
.url:"../../pageTeo",
success:function(){
}
})
}
//替换 没有返回键
onTap:function(){
wx:redirectTo({
.url:"../../pageTeo"
})
}
冒泡事件:点击子元素的事件  父元素的事件也会响应
bindtap 冒泡
catchtap 非冒泡
4:导入数据
``` var data = require(‘./data.js‘) module.export=data ```
5;使用模板文件template 有样式和xml
``` <template name=‘a‘> <view>...</view> </template> 应用:xml <import src="template/template.xml"/> <template is="a"/> ```
上线小程序 ,今天坐哪~解决打麻将不知道该坐哪的痛苦~比较粗糙哈哈哈哈~

标签:ima export fun 界面 nav ext for 循环 哈哈 跳转
原文地址:https://www.cnblogs.com/allenxieyusheng/p/8945118.html