WeChat Mini Program Grammar


Preface

There are no tags provided by H5 in the mini program. Here we need to use the components provided by the mini program.

1. Use of labels

1.view

view is equivalent to div in Html, which is a block element

2.text

text is equivalent to span in Html, which is an inline element

3.image

Image is equivalent to img in our Html, which is a common value for
the mode attribute of inline block elements.

Please add image description
Official documentation: https://developers.weixin.qq.com/miniprogram/dev/component/image.html

2. Data

1. Definition of data

Define data on the data attribute in the JS file corresponding to the interface

data:{
   
    
    
    msg:"hell world",
}

2. Quote data

Data can be referenced through { {}}.
You can also perform some calculations in { {}}, and the final displayed result is the result obtained after calculation.

data:{
   
    
    
    msg:"hell world",
    num:10,
}
<view>{
   
    
    {
   
    
    msg}}--{
   
    
    {
   
    
    num +

Guess you like

Origin blog.csdn.net/qq_50906507/article/details/127476169