In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of what matters should be paid attention to in the page development of WeChat Mini Programs, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe that after reading this WeChat Mini Programs page development should pay attention to what matters the article will have a harvest, let's take a look at it.
Considerations for the development of Mini Program:
1. Js file
The js file corresponding to each page can define the page onReady,onLoad,onShow,onHide,onUnload, as well as the page data, custom functions should be written together, and the internal convention is to write them all after the default function. "data first in the page, then default function, and then custom function" is convenient for review code and improves the efficiency of cooperation.
2. Json file
By default, it cannot be empty. Even if there is no content, it must be empty data {}. If the content originally defined in app.json needs to be redefined on the current page, then simply copy the content and directly assign a new value, which is used to set the status bar, navigation bar, title and window background color of Mini Program. What is commonly used is the title of the page
{"navigationBarTitleText": "my", "selfdata": "full stack engineer unreliable update", "tabBar": {"list": [{"pagePath": "pagePath", "text": "text", "iconPath": "iconPath", "selectedIconPath": "selectedIconPath"}], "position": "top"}}
I'm used to seeing the menu at the bottom. Let's have one at top.
3. Wxml file
The head and bottom of the page need to be encapsulated, made into a template, and imported into the page respectively.
Before, the good habit of HTML writing is to bring in head and foot. Of course, the business content is body. Each piece is wrapped in a view to facilitate the control of layout and class.
Get the data when the page is loaded, from the network or from the cache, and then render the data on the page through the content defined in the data of the page. There is a lot of use of specific rendering lists and conditions.
4. Wxss file
@ import "common.wxss"
Public style, reset style should be managed in advance according to different projects, do not use px, important things to say three times, Mini Program to ensure compatibility and adaptation to the use of the new unit rpx
5. Provide a button for the user to clean up the local cache. Equivalent to the reset switch of a project, cache data, file data, and authorization data may be used in different projects.
This is the end of this article on "what matters should be paid attention to in WeChat Mini Programs's page development". Thank you for your reading! I believe that everyone has a certain understanding of the knowledge of "what matters should be paid attention to in WeChat Mini Programs's page development". If you still want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.