zhump
zhump
对于extend/context.ts ,extend/helper.ts 扩展的 ctx和ctx.helper对象如何智能提示扩展后的对象方法。
其实已经使用了,但是没有提示出来。。。  controller.ts  helper.ts 
我用了export default {} ,helper.ts里面就不能使用 this.ctx ,代码检查就失败了。 
嗯嗯 被代码检查逼的 extend/helper.ts 使用了 module.exports。 采用 ``` test(this: BaseContextClass) ``` 确实解决了代码提示的问题。但this有时还会使用本身的方法属性。有些类 我改成 this:any了。虽然有点损失。但是代码提示和代码检查问题都解决了,多谢了🙏
nb...果然完美了。
发现两个问题。 第一个: midwayjs这样的库,他把app文件放到src,用户配置只能一个个的去覆盖,没有一个的统一baseUrl,方便用户迁移,当然手动现在可以临时解决。 https://github.com/whxaxes/egg-ts-helper/blob/master/src/index.ts 第二个: 还是上午的疑惑: ``` test(this: BaseContextClass & IHelper) { return this.ctx; } ``` vs ``` test(this: any) { return this.ctx; } ``` 前置无法在vscode中 this.ctx.helper.test提示出来,并且编译器报错。后者可以正常使用。
😂公司不给传代码到外网。 ``` egg-init --type=ts yarn yarn dev ``` 新增extend/helper.ts,除此之外一行代码未加。 ``` import { BaseContextClass, IHelper } from 'egg'; export default { a(this: BaseContextClass & IHelper) { }, b(this: any) { },...
可以了,目前没啥问题了。感谢大佬解答和产出这么棒的辅助工具。👍
准备学些 redux 相关生态,看到了 dva ... redux 、router 相关的 还需要单独去学习吗 懵逼了,而且以后 dva 所依赖的redux、router 什么什么的 都会维护更新吗
Which version can use resizableAxis ?