Skip to content

Commit b60cb4b

Browse files
authored
Merge pull request #259 from haiya6/master
fix(page): Autocomplete IShareOption 'from' field
2 parents 9ab0c8b + 5625675 commit b60cb4b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/page.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Page({
8383
onUnload() {},
8484
onPullDownRefresh() {},
8585
onShareAppMessage(res) {
86-
expectType<string>(res.from)
86+
expectType<'button' | 'menu'>(res.from)
8787
if (res.from === 'button') {
8888
expectType<string | undefined>(res.webViewUrl)
8989
}

types/wx/lib.wx.page.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ declare namespace WechatMiniprogram.Page {
199199
*
200200
* 最低基础库: `1.2.4`
201201
*/
202-
from: 'button' | 'menu' | string
202+
from: 'button' | 'menu'
203203
/** 如果 `from` 值是 `button`,则 `target` 是触发这次转发事件的 `button`,否则为 `undefined`
204204
*
205205
* 最低基础库: `1.2.4` */

0 commit comments

Comments
 (0)