diff --git a/lib/zin/wg/docapp/js/v1.js b/lib/zin/wg/docapp/js/v1.js index 786a0811c2..f8f9861255 100644 --- a/lib/zin/wg/docapp/js/v1.js +++ b/lib/zin/wg/docapp/js/v1.js @@ -1028,6 +1028,26 @@ const commands = } }); + /** + * 加载指定的 API 文档。 + * Load the specified API doc. + */ + loadApi: function(_, args) + { + const apiID = getApiID(args[0] || this.docID); + const version = args[1] || 0; + const release = args[2] || 0; + const select = !!args[3]; + $.getJSON($.createLink('api', 'ajaxGetApi', `apiID=${apiID}&version=${version}&release=${release}`), function(result) + { + if(!result || typeof result !== 'object') return; + result.id = `api.${apiID}`; + const docApp = getDocApp(); + docApp.update('doc', result); + if(select) docApp.selectDoc(result.id); + }); + }, + /** * 加载懒加载内容。 * Load the lazy content.