From f2bedef2856f926e84c123d0941880651412e6a5 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 9 Oct 2020 20:39:11 +0800 Subject: [PATCH] types(@vant/use): useEventListener target ref can be undefined --- package.json | 2 +- packages/vant-use/changelog.md | 6 ++++++ packages/vant-use/src/useEventListener/index.ts | 2 +- yarn.lock | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e8324f1ca..68b9a8460 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dependencies": { "@babel/runtime": "7.x", "@vant/icons": "1.3.1", - "@vant/use": "^0.0.7", + "@vant/use": "^0.0.8", "vue-lazyload": "1.2.3" }, "peerDependencies": { diff --git a/packages/vant-use/changelog.md b/packages/vant-use/changelog.md index cfd47cc5c..5c8372632 100644 --- a/packages/vant-use/changelog.md +++ b/packages/vant-use/changelog.md @@ -1,5 +1,11 @@ # 更新日志 +### v0.0.8 + +`2020-10-09` + +- 改进类型定义 + ### v0.0.7 `2020-10-06` diff --git a/packages/vant-use/src/useEventListener/index.ts b/packages/vant-use/src/useEventListener/index.ts index 507622288..b7b8e9031 100644 --- a/packages/vant-use/src/useEventListener/index.ts +++ b/packages/vant-use/src/useEventListener/index.ts @@ -23,7 +23,7 @@ if (inBrowser) { } export type UseEventListenerOptions = { - target?: EventTarget | Ref; + target?: EventTarget | Ref; capture?: boolean; passive?: boolean; }; diff --git a/yarn.lock b/yarn.lock index 84c6c3aa3..1d66ec93f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2212,10 +2212,10 @@ resolved "https://registry.yarnpkg.com/@vant/touch-emulator/-/touch-emulator-1.2.0.tgz#486300b23e57db9ce9231a04e0a0c621c68692d8" integrity sha512-sJ97zU85zOq51qoi7+CpBEcOyH3CitjP1KC7/GQwqaurUJni+EP7/F9n0HMnAh8GXMjgtgDBNJ5z48x+coNKYQ== -"@vant/use@^0.0.7": - version "0.0.7" - resolved "https://registry.npmjs.org/@vant/use/-/use-0.0.7.tgz#9ab1f54dd38c02b2707d2bcab7b725e81402db71" - integrity sha512-7QztMvrYWEJdlOd5xmQNjT+46AdoMZs9h9f72baAtHsl/a4Q+abTzVQo4Rg8E592djsDIVfnlWr9IZ1VomdJag== +"@vant/use@^0.0.8": + version "0.0.8" + resolved "https://registry.npmjs.org/@vant/use/-/use-0.0.8.tgz#46b0e957c8e4250a7e94951f20cfa6fdbd550a41" + integrity sha512-NO8yBGhE1jF2xnhgSeEDZUFlKXHtPzVNhxLnzH74P1Kdh3XrrQO6p+1ZL8HF52YMT2F1OY6FpaBC/WZmK3Xmog== "@vue/babel-helper-vue-transform-on@^1.0.0-rc.2": version "1.0.0-rc.2"