Home > Web Front-end > uni-app > body text

What is the difference between WeChat mini program and uniapp?

青灯夜游
Release: 2023-01-13 00:44:15
Original
20648 people have browsed it

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.

What is the difference between WeChat mini program and uniapp?

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&gt ;

  • if judgment:
    ①WeChat applet: <view wx:if="{<!-- -->{isShow}}">&lt ;/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>

  • ##Page parameters:

    ①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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template