浏览代码

docs: document macOS restrictions on `Menu::add_item` (#7983)

Amr Bashir 1 年之前
父节点
当前提交
dfe0badf19
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      core/tauri-runtime/src/menu.rs

+ 6 - 0
core/tauri-runtime/src/menu.rs

@@ -335,6 +335,12 @@ impl Menu {
   }
 
   /// Adds the custom menu item to the menu.
+  ///
+  /// ## Platform-spcific:
+  ///
+  /// - **macOS:** Only [`Submenu`] can be added to the menu
+  ///
+  /// [`Submenu`]: crate::Submenu
   #[must_use]
   pub fn add_item(mut self, item: CustomMenuItem) -> Self {
     self.items.push(MenuEntry::CustomItem(item));