This article mainly introduces the references of small programs and the simple instance code. For more information, see this article, and a simple instance code. For more information, see
Series of articles:
Mini-program tutorial-WXSS
References to mini-program tutorials
Events of mini-program tutorials
Small program tutorial template
List rendering of Applet tutorials
Conditional rendering of mini-program tutorials
Data binding in applet tutorial
Mini-program tutorial-WXML
Reference
WXML provides two file reference methods: import and include.
Import
Import can use the template defined in the target file in this file, for example:
A template named item is defined in item. wxml:
{{text}}
You can use the item template by referencing item. wxml in index. wxml:
Scope of import
Import has the concept of scope, that is, only the template defined in the target file will be imported, rather than the template of the target file import.
For example, C import B, B import A. in C, you can use the template defined by B. in B, you can use the template defined by A, but C cannot use the template defined by.
A template
B template
Include
Include can export the target file The entire code is introduced, which is equivalent to copying to the include position, such:
body
header
footer
Thank you for reading this article. I hope it will help you. thank you for your support for this site!
The above is the detailed content of the reference tutorial for small programs. For more information, see other related articles in the first PHP community!