diff --git a/components/menuitem/MenuItem.d.ts b/components/menuitem/MenuItem.d.ts index b0dff80f6..b0d97c06d 100644 --- a/components/menuitem/MenuItem.d.ts +++ b/components/menuitem/MenuItem.d.ts @@ -28,7 +28,6 @@ export interface MenuItemCommandEvent { /** * Defines model of MenuItem API. - * @group Model */ export interface MenuItem { /** diff --git a/layouts/doc/DocApiSection.vue b/layouts/doc/DocApiSection.vue index 87ebcb40c..568b13795 100644 --- a/layouts/doc/DocApiSection.vue +++ b/layouts/doc/DocApiSection.vue @@ -58,6 +58,8 @@ export default { let events = this.findEvents(values); const interfaces = this.findOtherInterfaces(values, docName); + const options = this.findOptions(values, docName); // Only for MenuItem + if (props && props.props.length) { newDoc.children.push({ id: `api.${moduleName}.props`, @@ -109,7 +111,7 @@ export default { } if (interfaces && interfaces.length > 0) { - const isValidDirective = this.checkDirectiveInterfaces(interfaces, docName); + const isValidDirective = this.checkDirectiveInterfaces(interfaces); if (!isValidDirective) return; @@ -132,6 +134,15 @@ export default { }); } + if (options) { + newDoc.children.push({ + id: `api.${moduleName}.options`, + label: 'Options', + component: DocApiTable, + data: this.setPropsData(options[0].values.props) + }); + } + newDocs.push(newDoc); } @@ -270,7 +281,20 @@ export default { return interfaces; }, - checkDirectiveInterfaces(interfaces, docName) { + findOptions(values, docName) { + if (docName !== 'MenuItem') return; + + const options = []; + + for (const key of Object.keys(values)) { + if (key === 'MenuItem') { + options.push({ key, values: values[key] }); + } + } + + return options; + }, + checkDirectiveInterfaces(interfaces) { const findMainInterface = interfaces.find((interfaceData) => interfaceData.key.includes('DirectiveBinding')); return !findMainInterface || findMainInterface.values.props.length > 0;