【发布时间】:2017-07-26 22:37:02
【问题描述】:
我已经像这样对我的函数进行了 jsdoc:
/**
* @typedef {Object} SearchTerms
* @property {string} what
* @property {string} where
* @property {boolean} online
*/
/**
* From react-router params, which are URL encoded, it figures out the "what", "where", and "online" terms.
*
* @export
* @param {Object} params The `params` field from react-router component props.
* @param {string} [params.what="Everything"] The subject of users search.
* @param {string} [params.where] The location of users search.
* @returns {SearchTerms}
*/
export function getSearchTerms(params) {
但是params 键在函数悬停时没有正确展开:
无论如何它可以正确扩展params 参数吗?我希望它显示出来:
除了它还应该用问号表明它是可选的。当我输入参数时,它应该显示该参数的描述,如下所示:
【问题讨论】: