View layer WXML: Event for practical development of WeChat applets

Source: Internet
Author: User
The previous article explains data binding, templates, logic, and so on. it mainly serves to display data and how to display it in a view. However, only the presentation is not enough. we need to interact with each other. For example, an HTML page can display text and images, but also have some interactions, such as links and buttons. The previous article explains data binding, templates, logic, and so on. it mainly serves to display data and how to display it in a view. However, only the presentation is not enough. we need to interact with each other. For example, an HTML page can display text and images, but also have some interactions, such as links and buttons.


Interaction is actually an event. For example, the onClick of the button in HTML is the action triggered when the button is clicked and the corresponding business logic of the developer.


I. event example: bindtap

Events are the communication between the view layer and the logic layer. Send user behavior feedback to the logic layer for processing. It is usually bound to a component. when triggered, the processing function is executed and parameters can be carried.


Create a button to redirect the page.

Index. wxml:

View layer WXML: Event


Index. js:
ToEvent: function (){

// Jump to the event. wxml page

Wx. navigateTo ({
Url: '/pages/wxml/event'
})
}


Animation

View layer WXML for practical development of small programs: for event-related articles, please follow the PHP Chinese network!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.