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

什么时候支持TypeScript或者提供d.ts文件 #44

Closed
Manweill opened this issue Aug 24, 2016 · 13 comments
Closed

什么时候支持TypeScript或者提供d.ts文件 #44

Manweill opened this issue Aug 24, 2016 · 13 comments

Comments

@Manweill
Copy link

什么时候支持TypeScript或者提供d.ts文件

@nikogu
Copy link
Member

nikogu commented Aug 24, 2016

@LeungManwei 其实 dva 现在已经支持 ts 了,因为底层使用的工具 atool-build 已经支持了,跟 dva 本身无关系,所以如果你要使用,参照 typescript 的官网说明(你既然要用,你肯定也清楚的)直接使用即可,只不过现在还没有对应的demo

@Manweill
Copy link
Author

Manweill commented Aug 24, 2016

@nikogu 跑起来是没啥问题,就是引用的时候提示缺少库,又不想手动写d.ts文件~。然后是,现在是刚刚准备把现有项目由es6+redux+antd转成ts+dva+antd这样子,但是ts是刚接触所以不太懂。有没有其他的办法解决缺少库这个提示问题呢。

@nikogu
Copy link
Member

nikogu commented Aug 24, 2016

@LeungManwei 看看提示信息呢

@Manweill
Copy link
Author

@nikogu 提示信息就是 " Cannot find module 'dva'. "

@nikogu
Copy link
Member

nikogu commented Aug 24, 2016

@LeungManwei 我稍后添加个 demo 好了

@Manweill
Copy link
Author

image
还有就是less文件的引入。。。也会提示这个问题。

@Manweill
Copy link
Author

@nikogu 好的,thx

@nikogu
Copy link
Member

nikogu commented Aug 24, 2016

@LeungManwei https://github.com/dvajs/dva/tree/add-ts-example/examples/count-ts 可以先看下

@Manweill
Copy link
Author

@nikogu thx,我研究看下

@nikogu
Copy link
Member

nikogu commented Aug 24, 2016

@LeungManwei 后续会给dva 添加index.d.ts文件,就直接用 typings 安装即可,现在还没搞

@wenzhihong2003
Copy link

同样期待 index.d.ts 这样, 这用在webstorm 上自动提示太有用了.

@zihuxinyu
Copy link

希望能有个完整的demo

@sorrycc
Copy link
Member

sorrycc commented Oct 18, 2016

已在 dva@1.1 支持,脚手架:https://github.com/sorrycc/dva-boilerplate-typescript

@sorrycc sorrycc closed this as completed Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants