Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Setting Properties of the Container Widget

Updated on 2025-03-24 GMT+08:00

The standard page offers basic flow and flexible layouts. The basic layout for standard pages is implemented by using the container widget.

A container widget is the fundamental building block for layout structures, similar to what a DIV does in CSS. DIV is a way to position and group content in CSS, and it stands for division. It is also sometimes called a layer. This DIV is an HTML tag that helps give structure and background to large pieces of content on a web page. You can think of a container as a blank page where you can set how the outside looks to control how the inside is laid out.

Figure 1 Container widget

Data Binding

Binds a property of a container widget, such as hiding, style, and elastic layout, to a specific model field. Once bound, these properties automatically update in sync with the model field's value, functioning in a manner akin to Vue's v-bind directive.

  1. In the Data Binding area, click + next to Property Binding.

    Figure 2 Clicking the add icon

  2. Select a property of the container from the Properties drop-down list.
  3. Under Field, click . The model selection page is displayed.

    Figure 3 Clicking the setting icon

  4. Click New.
  5. Set Model Name and Source, and click Next.

    Figure 4 Defining a model

    There are four types of models: Custom, Objects, Services, and Events. Each type of model contains parameter definitions and method definitions. Methods are APIs defined on models. In general, these APIs are called in event scripts (such as page loading events and mouse click events) associated with frontend widgets to implement certain logic.

    Table 1 Model types

    Type

    Model Description

    Model Parameter Description

    Model Method Description

    API Calling Method

    Custom

    Models defined by developers.

    Defined by developers. Subnodes can be added.

    Developer-defined method.

    $model.ref("modelName").actionName();

    Objects

    Object models are generated based on the mapping of the object table. For details about the object model, see Objects.

    The system automatically obtains all fields of an object. Developers can select some fields as parameters.

    The system automatically generates four methods: query, save, delete, and count.

    $model.ref("modelName").query(param);

    $model.ref("modelName").save();

    $model.ref("modelName").delete();

    $model.ref("modelName").count();

    Services

    Service models are generated by mapping backend services. Currently, service models can be mapped to flows or scripts. For details about the service model, see Flows and Scripts.

    The parameters are mapped to the inputParam and outputParam sections based on the input and output parameters of backend services.

    The run method is automatically generated to execute a flow or a script associated with the model.

    $model.ref("modelName").run();

    Events

    For event models, data binding is created based on fields of a backend event. Model data can be updated based on the web socket.

    Parameters are generated by mapping fields of backend events.

    Directly use.

    Directly use.

    In addition to the methods defined in models, the platform provides the following standard APIs for all models:

    • Obtaining model data: $model.ref("modelName").getData();
    • Setting model data: $model.ref("modelName").setData();
    • Setting model field values: $model.ref("modelName").setValue(key,value);

  6. On the Settings page of the new model, perform the following operations:

    • If Source is set to Custom in the previous step, you need to add customized parameters and types of subnodes.
    • If Source is set to Objects in the previous step, you need to configure the object and fields associated with the model.
    • If Source is set to Services in the previous step, you need to configure the backend service associated with the model. The backend service can be a script, flow, or public API.
    • If Source is set to Events in the previous step, you need to configure the event and event fields associated with the model.

  7. Click Next.

    Generally, you do not need to add a method. If you need to add or modify a method, refer to the method generated by the object and service by default.

  8. Click OK.

Basic Properties

  • Flow layout

    By default, Flexible Layout of the container widget is disabled and the container widget is in the flow layout state, as shown in Figure 5.

    Figure 5 Flow layout

    In the flow layout, a widget is a block-level element by default. That is, regardless of the widget width, the widget occupies the width of all parent elements. Drag a container widget to the canvas, then add two title widgets inside it, as shown in Figure 6. As block-level elements, these titles will expand to fill the container's width by default. The first title will appear at the top, with the second title automatically positioned below it.

    Figure 6 Block-level widgets in the flow layout

    In flow layout, widgets stack vertically, and their horizontal alignment within the container can be adjusted, as shown in Figure 7 and Figure 8.

    Figure 7 Align center horizontally
    Figure 8 Horizontal alignment to the right
  • Flexible layout

    After Flexible Layout is enabled, the layout is switched from the flow layout to the flexible layout. In the flexible layout attribute configuration, Direction, Justify, and AlignItems are displayed, as shown in Figure 9.

    Figure 9 Flexible layout

    Drag a container widget to the canvas, drag five container widgets into the first container widget, set the width and height of each container widget to 100 px, and set a different background color for each container widget, add a title widget to each container to display A, B, C, D, and E.

    In the default flexible layout, Direction is set to Row, Justify is set to Start, and AlignItems is set to Start, as shown in Figure 10.

    Figure 10 Default flexible layout effect

    Direction determines the arrangement direction of the widgets in the container. If Direction is set to Row, the widgets in the container are arranged from left to right. If Direction is set to Column, the widgets in the container are arranged from top to bottom, see Figure 11.

    Figure 11 Setting Direction to Column

    Justify determines the alignment of the container's principal axis. When Direction is Row, Justify applies to the horizontal direction. When Direction is Column, Justify applies to the vertical direction. When the alignment direction is set to row, the start point is left. When the horizontal alignment mode is set to center alignment and end alignment, the Figure 12 and Figure 13 are shown in the following figure.

    Figure 12 Setting Justify to Center
    Figure 13 Setting Justify to End

    AlignItems attribute determines how the containers are aligned along the cross axis. When Direction is set to Row, AlignItems applies to the vertical direction. When Direction is set to Column, AlignItems applies to the horizontal direction. When the container arrangement direction is row, the start point is the top, and the vertical alignment mode is center alignment and end alignment, as shown in Figure 14 and Figure 15.

    Figure 14 Setting AlignItems to Center
    Figure 15 Setting AlignItems to End

    You can configure flexible layout attributes to achieve the desired layout effect. For example, you can set Direction to Row and both Justify and AlignItems to Center, as shown in Figure 16.

    Figure 16 Center effect

Mobile Configuration

  • Fixed Bottom: After this function is enabled, the container widget is displayed at the bottom of the page when you preview the page on mobile devices.
    Figure 17 Displayed at the bottom of the page
  • Fixed Top: After this function is enabled, the container widget is displayed on the top of the page when you preview the page on mobile devices.
    Figure 18 Displayed on the top of the page
  • Button Fills Container: After this function is enabled, the button widget fills the entire container when a page is previewed on mobile devices.
    Figure 19 Button Filling Container
  • Button Displays in Single Row: After this function is enabled, the button widget and other widgets are displayed in one line during page preview on mobile devices.
    Figure 20 Button Displays in Single Row

Common

  • Name: name of the container widget displayed on the page.
  • Hide: indicates whether to hide the container widget when previewing a standard page.

Style

For users with rich frontend development experience, you can use the style panel to customize the page layout.

  • Layout: You can directly configure the CSS attributes of the page, for example, setting the width and height of a widget. You can also directly compile CSS code in Advance for further layout customization.
    • Display: You can quickly set the current element layout to block, inline-block, inline, or flex.
    • The box model diagram of the current element is displayed below Display. You can click the corresponding number and change the value to quickly change the inner and outer margins of the element.
    • The width and height of the current element are displayed below the current element box model diagram. By default, the width and height are adapted based on the current layout. You can manually enter values to configure the width and height of the current element.
    • When configuring the box model, width, and height, you can select multiple units, such as px, em, %, and auto.
      Figure 21 Style attribute configuration panel
  • Font: Set the font size, style, and color.
  • Background: Set the background color and transparency.
  • Border: Set the border color and width. The unit can be px, em, or %.
  • Shadow: Set the shadow color and style. The units px, em, and % are supported.
  • Advance: Directly write CSS code to apply to the current element. As shown in Figure 22, compile the style code to implement the same layout effect as Figure 16.
    Figure 22 Customizing CSS code to implement the widget centering effect

    If Layout of a widget is set in both Basic Properties and Style, the settings in Style take effect. For example, if Flexible Layout is selected in Basic Properties of a container widget and the block layout is selected in the Style > Layout area, the layout of the container widget is the block layout.

    • Style Code: Style code of the widget. After the widget style is set, the style code is automatically displayed in this area. You can also customize the style code to configure the widget in detail. Custom code can be entered in multiple lines, and style parameters are highlighted.
    • Style Class: Name of the CSS style class of the widget, which can be referenced in the CSS code.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback