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

函数名称内有 "Page" 关键字编译出错 #408

Closed
a709691139 opened this issue Aug 1, 2018 · 1 comment
Closed

函数名称内有 "Page" 关键字编译出错 #408

a709691139 opened this issue Aug 1, 2018 · 1 comment

Comments

@a709691139
Copy link
Contributor

问题描述
函数名称内有 "Page"就会编译出错,
onClick={this.toEditAddressPage.bind(this, "test")}

image

系统信息
系统: win10
Taro: 0.0.67

@yuche yuche changed the title 绑定带参数事件函数出错 onClick={this.toEditAddressPage.bind(this, "test")} 函数名称内有 "Page" 关键字编译出错 Aug 1, 2018
@luckyadam
Copy link
Member

你好~ 不是因为 Page 关键字,而是因为 toEditAddressPage 这个函数名比较长,长度为 17 ,如果在 JSX 中函数使用了 .bind,那么函数名会被加到元素属性上,小程序的属性名有长度限制,经过测试 0.0.67 版本这里函数名最长 15,最新的 beta 版本优化后,长度限制为 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants