From 537fd9a06d5bf3fbc1c73722585e7707181bb20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E6=B3=A2?= Date: Fri, 4 Jan 2019 22:02:56 +0800 Subject: [PATCH] weapp-api,export wx --- types/weapp-api/index.d.ts | 2 ++ types/weapp-api/weapp-api-tests.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 {