ui.root.add

將小工具新增至根面板。

傳回根面板。

用量傳回
ui.root.add(widget)ui.Panel
引數類型詳細資料
widgetui.Widget要新增的小工具。

範例

程式碼編輯器 (JavaScript)

// Replace the default UI widgets with a few custom widgets.
ui.root.clear();
ui.root.add(
  ui.Panel({
    widgets:[
      ui.Label('This is a custom user interface.'),
    ],
    style: {border: '5px solid green'}
  })
);
ui.root.add(ui.Map());