May 18, 2021 WeChat Mini Program Development Document
A global object of the program API that is used to host a small program capability-related API.
Object wx.env
The small program environment variable object
String wx.env.USER_DATA_PATH
The user directory path in the file system
Print the logs to the debug panel. C onsole is a global object that can be accessed directly. In the WeChat client, output the logs to vConsole.
Print the debug log to the debug panel
Log content, can have as many as anywhere.
Print the error log to the debug panel
Log content, can have as many as anywhere.
Create a new grouping in the debug panel. T he output is then indented to indicate that the content belongs to the current grouping. The group ends after calling console.groupEnd.
Group tags, optional.
Valid only in tools, empty function implementation in vConsole.
Ends the grouping created by console.group
Valid only in tools, empty function implementation in vConsole.
Print the info log to the debug panel
Log content, can have as many as anywhere.
Print the log log to the debug panel
Log content, can have as many as anywhere
Print the warn log to the debug panel
Log content, can have as many as anywhere.
Set a timer. A registered callback function is executed after the time expires
Callback function
Delayed time, the call to the function occurs after that delay, in ms.
Additional parameters such as param1, param2, ..., paramN, which are passed as arguments to the callback function.
The number of the timer. This value can be passed to clearTimeout to cancel the time.
Cancel the timer set by setTimeout.
The ID of the timer to cancel
Set a timer. The registered callback function is executed in milliseconds for the specified period
Callback function
The interval between the execution callback functions, in ms.
Additional parameters such as param1, param2, ..., paramN, which are passed as arguments to the callback function.
The number of the timer. This value can be passed to clearInterval to cancel the time.
Cancel the timer set by setInterval.
The ID of the timer to cancel