Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button的openType没有定义addFriend。导致ts报错 #5738

Closed
jayden320 opened this issue Mar 19, 2020 · 3 comments · Fixed by #7390
Closed

Button的openType没有定义addFriend。导致ts报错 #5738

jayden320 opened this issue Mar 19, 2020 · 3 comments · Fixed by #7390
Assignees
Labels
A-typings Area - TypeScript Typings 相关
Milestone

Comments

@jayden320
Copy link

jayden320 commented Mar 19, 2020

问题描述

Button的openType没有定义addFriend。导致ts报错。
另外,Button也缺少openId的定义。

复现步骤

创建项目,启用Type Script。
使用Button,openType使用addFriend。
ts报错。

<Button className='btn' size='mini' openType='addFriend' openId='123' onClick={this.addFriend}>

期望行为

ts不报错

报错信息

Type '"addFriend"' is not assignable to type '"contact" | "contactShare" | "share" | "getRealnameAuthInfo" | "getAuthorize" | "getPhoneNumber" | "getUserInfo" | "lifestyle" | "launchApp" | "openSetting" | "feedback" | undefined'.

系统信息

👽 Taro v2.0.7

Taro CLI 2.0.7 environment info:
System:
OS: macOS 10.15.3
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmGlobalPackages:
typescript: 3.8.3

补充信息

附QQ小程序button文档地址
https://q.qq.com/wiki/develop/miniprogram/component/form/button.html

@taro-bot
Copy link

taro-bot bot commented Mar 19, 2020

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented Mar 19, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam
Copy link
Member

luckyadam commented Mar 20, 2020

可以提个 PR 哦

@Chen-jj Chen-jj assigned ZakaryCode and unassigned Chen-jj Jul 3, 2020
@Chen-jj Chen-jj added the A-typings Area - TypeScript Typings 相关 label Jul 3, 2020
@Chen-jj Chen-jj added this to the 3.0.8 milestone Aug 20, 2020
@Chen-jj Chen-jj linked a pull request Aug 20, 2020 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typings Area - TypeScript Typings 相关
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants