In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "what are the common problems in the development of WeChat Mini Programs and how to solve them?" so the editor summarizes the following contents, which are detailed, the steps are clear, and have a certain reference value. I hope you can get something after reading this article. Let's take a look at this article, "what are the common problems in WeChat Mini Programs development and how to solve them?"
Common problems and Solutions in the Development of WeChat Mini Programs 1: "Expecting 'String,'Number,'NULL,'True....'"'' The error prompt of.
Solution:
The reason for this error is that {} is not added to index.json (the json file for the corresponding page). Even if there is nothing in the json file, you need to add a {} as the default code. In addition, commenting code is not allowed in json files, and this error will also be reported if there is commented code.
2: there is a "script error or incorrect call to Page ()" error message.
Solution:
The reason for this error is usually that the Page method is not called in index.js (that is, the js file of the corresponding page). Even if there is no code in the js file, you need to add an empty Page ({}) to the js. Note that the P of Page should be capitalized.
3: "Failed to load image http://xxx xxxxx:the server responded with a status of 404 (HTTP/1.1 404 Not Found) From server 127.0.0.1" appears
Solution:
This error is usually caused by the wrong path to the picture. If the picture of the extranet is wrong, the url of the picture of your extranet is wrong (because it does not have the concept of relative and absolute path). Now let's just talk about the local picture path. In such a case, if the image path is written in an A.js file and the B.js file references A.js, the image path must be relative to the B.js. It is recommended that you use absolute paths in public js files.
4: there is a problem with the warning message "Now you can provide attr wx:keyfor a wx:for to improve performance".
Solution:
First of all, this is just a warning message, not an error message, and ignoring it will not have any impact on the running of the program. The original words of the official document: if you do not provide a wx:key, you will report a warning, and if you clearly know that the list is static, or do not have to pay attention to its order, you can choose to ignore it. If you definitely want to remove this warning, you can add a wx:key=unique,unique to the component properties of wx:for and replace it with the field name of any field in the data binding list, such as the field "postId", or wx:key=postId, in the article list data. Wx:key=*this is not recommended. In fact, wx:key is used to specify a primary key to the data rendered by the list to speed up the rendering of the list.
5: how does Mini Program quickly create a page file?
Solution:
WeChat Mini Programs's official documentation does not give a method for creating four types of page files at a time. However, in the actual development process, someone found a way to quickly create four files. Step: in the pages array under the app.json file, add a path to the page. If the path points to a file that does not exist, then the MINA framework will automatically create four files for the page. We can try to add a "pages/demo/demo" to the pages array of the app.json file, and then save the project. Creating the file in this way is not only quick, but also the page file will automatically add some default code to prevent errors.
The above is about the content of this article on "what are the common problems in WeChat Mini Programs's development and how to solve them?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please 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.