In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what are the common problems in the development process of WeChat Mini Programs. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Q: why can't objects such as window be used in scripts
A: the script logic of the page runs in JsCore. JsCore is an environment without window objects, so you cannot use window in a script, nor can you manipulate components in a script.
Q: why zepto/jquery can't be used
A:zepto/jquery uses window objects and document objects, so it cannot be used.
Q:wx.navigateTo could not open the page
A: an application can only open five pages at a time. After five pages have been opened, wx.navigateTo cannot open a new page normally. Avoid multiple levels of interaction, or use wx.redirectTo
Q: stylesheets do not support cascading selectors
A:WXSS supports. The class selector that starts.
Q: local resources cannot be obtained through css
A:background-image: you can use web pictures, or base64, or use tags
Q: how to modify the background color of a window
A: using the page tag selector, you can modify the style of the top-level node
Page {
Display: block
Min-height: 100%
Background-color: red
}
Q: why the upload is not successful
A: in order to improve the fluency of the experience, the size of the compiled code package should be less than 1MB, and the code package larger than 1MB will fail to upload.
The Q:HTTPS request was not successful
A:tls only supports version 1.2 and above.
Q: referer of the network request
A: the referer of a network request cannot be set, and the format is fixed as https://servicewechat.com/{appid}/{version}/page-frame.html, where {appid} is the appid of Mini Program, {version} is the version number of Mini Program, and a version number of 0 indicates the development version.
Q: cannot operate Page.data directly
A: avoid directly modifying the assignment of Page.data. Use Page.setData to synchronize data to the page for rendering. How to get user input
For a component that can get user input, you need to use the component's property bindchange to synchronize the user input to AppService.
Var inputContent = {}
Page ({
Data: {
InputContent: {}
}
BindChange: function (e) {
InputContent [e.currentTarget.id] = e.detail.value
}
})
Q: does WeChat Mini Programs support fetch or promise?
The A:promise tool is not currently supported, and the fetch client does not support the consistency of the next version of the tool.
CurrentTarget in the Q:touchmove sliding event. The value of id does not change.
The target / currentTarget of the A:ouchmove / touchend event will always be the target / currentTarget of touchstart.
The parameter of the POST method of Q:wx.request transfers the bug that cannot be received by the server.
The content-type for A:wx.request post defaults to 'application/json'
If the server does not use the json interpretation, you can set the content-type back to urlencoded.
Wx.request ({
....
Method: "POST"
Header: {
"content-type": "application/x-www-form-urlencoded"
}
...
})
Q:wx.uploadFile returns the http code 403 on the phone.
A: upgrade Android Wechat to 6.5.2 and above.
Q: does Mini Program SVG support it?
A:image 's src can be put into a remote svg, or in background-image.
Q:wx.request returned inconsistent types on both sides of the statusCode.
A: this problem does exist and will be fixed in a later version.
Q: about the dynamic generation and destruction of components?
A: dynamic generation of components is not supported, but you can use wx:for to render multiple components.
Q: does Mini Program support Hot change?
A: developers are not allowed to replace themselves.
Q: the callback IOS of some APIs is inconsistent with Android. For example, after the user cancels the payment, ios only calls back the complete method, and android calls back the fail method. There is no description of callback in the official document, which makes it very difficult to develop. Similarly, there are image selection APIs, sharing APIs and so on.
A: payment API. After the user cancels the payment, ios only calls back the complete method, and android calls back the fail method. The problem has been recorded. Thank you for your feedback.
Q: if icon is already on the server, is it possible to load the picture by visiting the URL directly?
A: no.
Can't use Mini Program for Q:ipad?
A: ipad is not supported to open Mini Program at this time.
Q: Mini Program audio and video player problems. 1. Can you just hide the progress bar and time? 2. Now the time display on the iOS platform is 0:00, but an error code will be displayed on the android. Can you change it through any settings?
Avatar 1: the next version will modify the interaction here without showing the progress bar and time. This issue has been fixed in version 6.5.3 of 2RV.
Q: can I add a floating layer to the photo window?
A: not for the time being.
Q: developer tools often report jsEngineScriptError errors, which will cause the page to go blank.
A: try downloading the latest version of 0.12.130400.
Q: in the developer tool, the SPA page is invalid to change the title.
A:wx.setNavigationBarTitle can change the navigation bar title through API.
Q: does the Mini Program page support long pressing to save or share pictures?
A: there is no such feature at present.
Q: about the current problem in swiper. If you set current directly in the new version, the effect is that no matter which swiper element you click into, the value of the first child element of swiper will be displayed.
A: at present, swiper has some bug when dealing with dynamic changes in swiper-item, which will be fixed soon.
Q: can Mini Program reference wxss and js files on its own server?
A: no, the remote code cannot be executed.
Q: Apple 7, internal error, excessive memory usage.
A: the page is preloaded. There are pictures in the list. There are too many pictures rendered. The solution is not to display the pictures on the screen properly and not to let them render.
Q: Mini Program experiencer Andrika can't get into the loading page, IOS can go in.
A: this is the old version of bug for android Wechat client. Please download the latest version of 6.5.3 client.
Q: does WeChat Mini Programs support Bluetooth at present?
A: it is not supported at present.
Q: does the real machine of sharing function have no effect?
A: this is the old version of bug for android Wechat client. Please download the latest version of 6.5.3 client.
Q: mandatory use of https, how to jointly debug and test in a development and test environment?
A: "Wechat web developer tools"-> "Project"-> "Development environment does not verify the requested domain name and TLS version".
The Q:wx.showToast () method is invalid.
Call wx.request to request the network and then call the
Complete: function (res) {
/ / complete
Wx.hideToast ()
}
Q does not pop up a prompt box if it feels invalid when it comes to showToast in the success method.
The A:success callback call comes before complete. If it is in success showToast, the next step complete hideToast will be washed out of showToast.
Does the text size in the Q:picker component support modification?
A: modification is not supported.
Q:tabBar images are too different in size between android and ios.
A: this is the old version of bug for android Wechat client. Please download the latest version of 6.5.3 client.
The Q:tabbar page returned a question. Non-home tabbar page how to return to the Mini Program home page when clicking on the upper left corner to return to the arrow? Now I just quit Mini Program.
A: when you create a new page, use navigateTo to create a new page, while keeping the old page. If you use redirectTo, you will jump within the current page.
Q: ask how wx.request () is set to synchronize.
A:reqeust initiates a network request. There is no synchronization interface.
Q: the latest mac version of the tool is not available, there is a failure to get appservice.
A: select direct link to the network in the tool settings. Or the agent software setup tool in the system connects directly to the network.
Q: the decline of the real view overflow-y will be very slow.
A: the parent layer needs position:relative; and will not be stuck after it is added.
This is the end of this article on "what are the common problems in the development process of WeChat Mini Programs?". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.