我正在尝试将customTag添加到jsdoc.我在plugins目录中创建了一个文件,如下所示:
method.js
exports.defineTags = function(dictionary) {
dictionary.defineTag("methodHttp",{
mustHaveValue: true,canHaveType: false,canHaveName: true,onTagged: function(doclet,tag) {
doclet.methodHttp = tag.value;
}
});
};
然后我加入了我的conf.json:
{
"tags": {
"allowUnknownTags": true
},"source": {
"includePattern": ".+\\.js(doc)?$","excludePattern": "(^|\\/|\\\\)_"
},"plugins": [ "plugins/method" ],"templates": {
"cleverLinks": false,"monospaceLinks": false,"default": {
"outputSourceFiles": true
}
},"jsVersion": 180
}
现在我尝试在我的模板上得到这个.我在method.tmpl上.
我试过了:
self.find('methodHttp')[0]
data.methodHttp[0]
data.methodHttp
但它不起作用.我的代码出了什么问题?
最佳答案
原文链接:https://www.f2er.com/js/429706.html