【问题标题】:How to extend es6 child class functions parameters?如何扩展 es6 子类函数参数?
【发布时间】:2020-01-30 16:02:46
【问题描述】:

我想为从基类继承的函数覆盖 jsdoc。

函数向基函数添加参数。

父母:

export default class Base {
    /**
     * Function apply().
     *
     * Apply the hook.
     *
     * @param {{}} args
     *
     * @returns {Boolean}
     */
    apply( args ) {
        throw Error( 'apply() must be implanted.' );
    }
}

孩子:

export default class Child extends Base {
    /**
     * how to override jsdoc and point out that i
     * have added containers param?
     */
    apply( args, containers ) {
    }
}

【问题讨论】:

    标签: javascript ecmascript-6 jsdoc


    【解决方案1】:

    我认为@override 标签会很有用。 https://jsdoc.app/tags-override.html供参考

    【讨论】:

      猜你喜欢
      • 2019-12-17
      • 2016-10-09
      • 1970-01-01
      • 1970-01-01
      • 2012-11-09
      • 2018-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多