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

[Enhance] 提供与视图交互的回调函数类型 #7

Open
fimars opened this issue Nov 26, 2018 · 2 comments
Open

[Enhance] 提供与视图交互的回调函数类型 #7

fimars opened this issue Nov 26, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@fimars
Copy link
Contributor

fimars commented Nov 26, 2018

<button data-idx="1" bind:tap="callback" />
callback: onTapCallback<{idx: number}> (ev) {
	// 就能更舒服得使用 ev.dataset.idx
}

不知道有没有加这些回调的类型支持的打算?

@Adherentman
Copy link
Owner

在尝试解决。。是否有更好的解决方案可以推荐吗?

@fimars
Copy link
Contributor Author

fimars commented Feb 13, 2019

如果只是d.ts(类型声明文件)的话貌似没有什么特别好的办法了;
我自己的话是用ts开发的小程序项目,然后稍微弄了个修饰器增强了回调函数的类型。

@Adherentman Adherentman added the enhancement New feature or request label Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants