wechat-miniprogram / wechat-miniprogram/api-typings

Please fix selectAll's return define

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
803
Forks
117
Avg merge
24m
Merged PRs (30d)
1

Description

wx.createSelectorQuery().selectAll('.section').boundingClientRect(res => {
  res.forEach(e => console.log(e.bottom)) // res.forEach报错, e.bottom 为 any
})

boundingClientRect 以及 scrollOffset 的回调有些许问题。

参考 #194

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #194 and locating the TypeScript declarations for selectAll, boundingClientRect, and scrollOffset. Verify the callback types against the example, then update the definitions so the selected elements and scroll data are no longer inferred as any and confirm the reported errors are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.