Home > Article > Web Front-end > What is the difference between WeChat mini program and uniapp?
Differences: 1. In terms of touch event names, the WeChat applet is bindtap and uniapp is "@click"; 2. In terms of if judgment, the WeChat applet uses "wx:if="{{isShow}}" statement, uniapp uses the "v-if="isShow"" statement.
The operating environment of this tutorial: Windows 10 system, uni-app version 2.5.1, Dell G3 Computer.
Recommended: "uni-app Development Tutorial"
The difference between WeChat applet and uniapp
Touch event name:
①WeChat applet:bindtap
②uni-app:@click
Function parameter passing method:
① WeChat applet: <view bindtap="click" data-id="id"></view>
②uni-app: <view @click="click(id)"></view>
Function receiving parameters:
①WeChat applet: function(e){this.setData(currentId:e.currentTarget.dataset.id)}
②uni-app:function(id){this.currentId = id}
for loop:
①WeChat applet: <view wx:for="{<!-- -->{currentList}}" wx:for-index="s_index" wx :for-item="s_item"></view>
②uni-app:<view v-for="(s_item,s_index) in currentList"></view> ;
if judgment:
①WeChat applet: <view wx:if="{<!-- -->{isShow}}">< ;/view>
②uni-app:<view v-if="isShow"></view>
src Dynamically receive pictures:
①WeChat applet: <image src="{<!-- -->{item.img}}"></image>
②uni-app:<image :src="$util.img(item.img)"></image>
①WeChat Mini program:
The above is the detailed content of What is the difference between WeChat mini program and uniapp?. For more information, please follow other related articles on the PHP Chinese website!