跳到主要內容
+

豐富樹狀檢視 - 焦點

了解如何聚焦樹狀檢視項目。

命令式 API

聚焦特定項目

使用 focusItem API 方法來聚焦特定項目。

apiRef.current.focusItem(
  // The DOM event that triggered the change
  event,
  // The id of the item to focus
  itemId,
);
按下 Enter 開始編輯

API

請參閱以下文件,以取得此處提及之元件可用的所有 props 和 classes 的完整參考。