How to make link of method parameter type in jsDoc

谁说胖子不能爱 提交于 2019-12-10 13:59:09

问题


Is there any natural way or special tag to make parameter type as link?

/**
* My js app
* @module app
*/
/** 
* Namespace for MYAPP classes and functions.
* @namespace HUMAN_RESOURCE
*/
var HUMAN_RESOURCE = HUMAN_RESOURCE || {};

/**
* @class JustClass
* @constructor
*/
HUMAN_RESOURCE.JustClass = function(){ }

/**
* Constructs Person objects
* @class Person
* @constructor
* @param {String} First name
* @param {String} Last name
*/
HUMAN_RESOURCE.Person = function (first, last) {    
    /**
    * First name of the Person
    * @property first_name
    * @type String
    */
    this.first_name = first;

    /**
    * @property f_createPerson
    * @param {Person} [_person] açıklama
    * @return {Person} Person type object
    */
    this.f_createPerson = function(_person, _person2){ return new Person() }
};

/**
* Return Person's full name
* @alias getName
* @memberof! HUMAN_RESOURCE.Person#
* @return {String} First name + last name
*/
HUMAN_RESOURCE.Person.prototype.getName = function () {
    return this.first_name + ' ' + this.last_name;
};

回答1:


Fortunately yes, it is just not always obvious what the correct name path is (but you can basically see it at the top of your generated docs)

/**
* @property f_createPerson
* @param {module:app~HUMAN_RESOURCE.Person} [_person] açıklama
* @return {module:app~HUMAN_RESOURCE.Person} Person type object
*/
this.f_createPerson = function(_person, _person2){ return new Person() }


来源:https://stackoverflow.com/questions/29622478/how-to-make-link-of-method-parameter-type-in-jsdoc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!