当前位置:网站首页>Composition of applet code

Composition of applet code

2022-07-05 20:25:00 'wx

1.WXML Templates

WXML and HTML The difference between

(1). Different label names

HTML(div,span,img,a)

WXML(view,text,image,navigator)

(2) Attribute nodes are different

<a href="#"> Hyperlinks </a>
<navigator url="pages/home/home"></navigator>

(3) Offer something similar to vue Template syntax for

         Data binding

         The list of rendering

Conditions apply colours to a drawing

2.WXSS style

(1) Added rpx Unit of measure , The screen of different sizes will be converted automatically

(2) Provides global and local styles

         In the root directory of the project app.wxss Will work on all applet pages

Of partial pages .wxss The style is only valid for the current page

(3)WXSS Only partial css Selectors

         Class selector and id Selectors

         Element selector

         Union selector , Descendant selector

Pseudo class selector

3.JS Logical interaction
(1)app.js

        It is the entry file of the whole applet project , By calling App() Function to start the entire applet

(2) Page .js file

        Is the entry file of the page , By calling Page() Function to create and access pages

(3) ordinary .js file

        It is a common function module file , Used to encapsulate public functions or properties for use by pages

原网站

版权声明
本文为['wx]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207052018303010.html