ui.root.add

Thêm một tiện ích vào bảng điều khiển gốc.

Trả về bảng điều khiển gốc.

Cách sử dụngGiá trị trả về
ui.root.add(widget)ui.Panel
Đối sốLoạiThông tin chi tiết
widgetui.WidgetTiện ích sẽ được thêm.

Ví dụ

Trình soạn thảo mã (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());