瀏覽代碼

Restore JupyterLabMenu missing `menu` attribute (#10567)

Fixes #10565
Frédéric Collonval 3 年之前
父節點
當前提交
59fa2b0118
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18 0
      packages/ui-components/src/components/menu.ts

+ 18 - 0
packages/ui-components/src/components/menu.ts

@@ -34,6 +34,14 @@ export interface IRankedMenu extends IDisposable {
    */
   readonly items: ReadonlyArray<Menu.IItem>;
 
+  /**
+   * The underlying Lumino menu.
+   *
+   * @deprecated since v3.1
+   * RankMenu inherits from Menu since v3.1
+   */
+  readonly menu: Menu;
+
   /**
    * Menu rank
    */
@@ -93,6 +101,16 @@ export class RankedMenu extends Menu implements IRankedMenu {
     this._includeSeparators = options.includeSeparators ?? true;
   }
 
+  /**
+   * The underlying Lumino menu.
+   *
+   * @deprecated since v3.1
+   * RankMenu inherits from Menu since v3.1
+   */
+  get menu(): Menu {
+    return this;
+  }
+
   /**
    * Menu rank.
    */