The view layer WXML of WeChat applets binds data, templates, templates...

Source: Internet
Author: User
Practical development of applets ④ --- View layer WXML binding data, templates, templates... the previous article introduced the MVC structure of applets:

Page. js is the control layer (C), also called the business logic layer;

Data attribute in page. js, that is, data model layer (M );

Page. wxml is the presentation layer (V );

Page. wxss is css, enhancing the display layer effect.


Modify the data attribute (M) through the business logic layer (C) to display the data in the presentation layer (V.

That is, the MVC design pattern.


I. data binding

First, let's take a look at the MVC process structure of the Page.

If a variable is defined in data, such

Page ({data: {title: 'Small program practice tutorial ', desc: 'View layer-wxml '}})

You can use {title} on the page to display the effect, as shown in the figure below:

For more information about how to bind data, templates, and templates to the view layer WXML of applets, see The PHP Chinese web!

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.