diff --git a/types/weapp-api/index.d.ts b/types/weapp-api/index.d.ts index fec6f90f14..5eb9c36175 100644 --- a/types/weapp-api/index.d.ts +++ b/types/weapp-api/index.d.ts @@ -1403,3 +1403,5 @@ declare function setInterval(callback: functions, delay: number, rest: any): num * @param timeoutID 要取消的定时器的ID */ declare function clearInterval(timeoutID: number): number; + +export default wx diff --git a/types/weapp-api/weapp-api-tests.ts b/types/weapp-api/weapp-api-tests.ts index 4363179c80..5b2b0616a2 100644 --- a/types/weapp-api/weapp-api-tests.ts +++ b/types/weapp-api/weapp-api-tests.ts @@ -1,12 +1,13 @@ +import wx from './index' App({ onLaunch: function () { //调用API从本地缓存中获取数据 - var logs = wx.getStorageSync('logs') as Array || [] + let logs = wx.getStorageSync('logs') as Array || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) }, getUserInfo: function (cb: Function) { - var that = this; + let that = this; if (this.globalData.userInfo) { typeof cb == "function" && cb(this.globalData.userInfo) } else {