优特云
[ { "name": "首页", "url": "http://www.utyun.com/", "target": "0", "child": [] }, { "name": "活动", "url": "https://pre-mobile.utyun.com/page-design/?__UT_TITLE__=%E4%BC%98%E7%89%B9%E4%BA%91%E7%A7%91%E6%8A%80-%E4%BA%91%E6%9C%8D%E5%8A%A1%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E5%AE%9A%E5%88%B6%E5%95%86#/8412299005246101317/events", "target": "0", "child": [] }, { "name": "产品", "url": "https://pre-mobile.utyun.com/page-design/?__UT_TITLE__=%E4%BC%98%E7%89%B9%E4%BA%91%E7%A7%91%E6%8A%80-%E4%BA%91%E6%9C%8D%E5%8A%A1%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E5%AE%9A%E5%88%B6%E5%95%86#/8412299005246101317/products", "target": "0", "child": [] }, { "name": "关于优特云", "url": "https://pre-mobile.utyun.com/page-design/?__UT_TITLE__=%E4%BC%98%E7%89%B9%E4%BA%91%E7%A7%91%E6%8A%80-%E4%BA%91%E6%9C%8D%E5%8A%A1%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E5%AE%9A%E5%88%B6%E5%95%86#/8412299005246101317/about", "target": "0", "child": [] } ]
布局组件
容器

用户5594 最后一次编辑

10 个月前 275


description: >-
Container widget reference

Container

This page describes how to use Container widgets to group multiple widgets. You can either drop the widgets inside a Container widget or select the widgets and use cmd+g to create a Container widget.

Content properties

These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.

General

Visible boolean

Controls the visibility of the widget. If you turn off this property, the widget is not visible in View mode. Additionally, you can use JavaScript by clicking on JS next to the Visible property to control the widget's visibility conditionally.

For example, if you want to make the widget visible only when the user checks an item in a Checkbox widget, you can use the following JavaScript expression in the visible property of the Container widget:

{{Checkbox1.isChecked}}

Animate Loading boolean

Controls whether the widget is displayed with a loading animation. When enabled, the widget shows a skeletal animation during the loading process. Additionally, you can control it through JavaScript by clicking on the JS next to the property.

Height string

This property determines how the widget's height adjusts to changes in its content. There are three available options:

  • Fixed: The height of the widget remains as set using drag and resize.
  • Auto Height: The widget's height adjusts dynamically in response to changes in its content.
  • Auto Height with limits: Same as Auto height, with a configurable option to set the minimum and maximum number of rows the widget can occupy.

Style properties

Style properties allow you to change the look and feel of the widget.

Color

Background color string

Sets the background color of the widget. If JavaScript is enabled, you can specify a valid CSS color value to adjust the background color.

Border color string

Sets the border color of the widget. If JavaScript is enabled, you can specify a valid CSS color value to adjust the border color.

Border and shadow

Border width string

Sets the width of the widget's border.

Border radius string

Applies rounded corners to the outer edge of the widget. If JavaScript is enabled, you can specify valid CSS border-radius to adjust the radius of the corners.

Box Shadow string

This property adds a drop shadow effect to the frame of the widget. If JavaScript is enabled, you can specify valid CSS box-shadow values to customize the appearance of the shadow.

Reference properties

Reference properties enable you to access the widget's data and state using the dot operator in other widgets or JavaScript functions. They provide additional information or allow interaction with the widget programmatically. For instance, to retrieve the visibility status of a Container widget, you can use Container1.isVisible.

isVisible boolean

The

isVisible property indicates the visibility state of a widget, with true indicating it is visible and false indicating it is hidden.

Example:

{{Container1.isVisible}}

backgroundColor string

Represents the widget's Background Color setting as a CSS color value.

Example:

{{Container1.backgroundColor}}

Methods

Widget property setters enable you to modify the values of widget properties at runtime, eliminating the need to manually update properties in the editor.

These methods are asynchronous and return a Promise. You can use the .then() block to ensure the execution and sequencing of subsequent lines of code in Appsmith.

setVisibility (param: boolean): Promise

Sets the visibility of the widget.

Example:

Container1.setVisibility(true)

优特云