【发布时间】:2017-04-18 23:49:40
【问题描述】:
对对象使用 JSDoc 的 @mixin,我可以这样写:
/**
* @mixin foo
*/
const foo = {
myMethod() {}
}
/**
* @mixes foo
*/
const bar = {
}
我的 WebStorm IDE 显示 bar 有一个 myMethod 方法。我喜欢使用 core-decorators 中的 @mixin 装饰器在我的类中混合一些对象:
/*
* @mixes foo
*/
@mixin (foo)
class bam {
}
很遗憾,WebStorm 没有为 myMethod 显示 bam 类的自动完成功能。
我应该怎么做(除了将 foo 定义为类并对其进行扩展,由于将使用多个 mixin,这不是一个选项)?
【问题讨论】:
标签: javascript webstorm jsdoc