【问题标题】:How to use jsdoc's @mixes for ES6 classes in combination with WebStorm如何结合 WebStorm 将 jsdoc 的 @mixes 用于 ES6 类
【发布时间】: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


    【解决方案1】:

    很遗憾@mixin + @mixes 目前不适用于 ES6,请关注WEB-23997 获取更新

    【讨论】:

    • :(thanx 的信息。我希望它得到修复。
    猜你喜欢
    • 1970-01-01
    • 2018-12-30
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    • 2014-03-04
    • 1970-01-01
    • 1970-01-01
    • 2016-05-26
    相关资源
    最近更新 更多