This time I will show you how to use vue to make a mobile WeChat official account, and what are the precautions for using vue to make a mobile WeChat official account. The following is a practical case, let's take a look.
The first pitfall: WeChat sharing causes the Android phone to be unable to open the photo album and cannot activate WeChat recharge
Solution:
setTimeout(_ => { wx.config(sdkConfig) }, 500)
Second Pitfall: Some third-party input methods on mobile phones will squeeze the page online
Solution:
// 特定需求页面,比如评论页面,输入框在顶部之类的 const interval = setInterval(function() { document.body.scrollTop = 0; }, 100) // 注意关闭页面或者销毁组件的时候记得清空定时器 clearInterval(interval);
The third pit: Mobile 4Gpost submission in some areas does not respond
My vue project is interface encapsulated by axios. In the project, there are always requests from some areas but no response. I will check later. Finally, the backend only received the options request. The key is that this situation only occurs for individual users. I will read the article laterhttps://itbilu.com/javascript/js/VkiXuUcC .html introduces these requests, let’s go straight to the code without further explanation
Solution:
import axios from 'axios' import qs from 'qs' service.interceptors.request.use( config => { if(config.method === 'post'){ config.data = qs.stringify(config.data) } return config }, error => { console.log(error) Promise.reject(error) } )
Node.js console output log file example analysis
How to use Vue to achieve drag and drop effects
The above is the detailed content of How to use vue to create a mobile WeChat public account. For more information, please follow other related articles on the PHP Chinese website!