• "Flex弹性布局"组件:<flex-row><flex-col> —— 快应用组件库H-UI


    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row h-style="margin-top: 30px;margin-bottom: 30px;">
                <flex-col bg-color="bg-primary" justify="center">
                    <text>A</text>
                </flex-col>
                <flex-col bg-color="bg-info" justify="center">
                    <text>B</text>
                </flex-col>
                <flex-col bg-color="bg-primary" justify="center">
                    <text>C</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row h-style="margin-top: 30px;margin-bottom: 30px;">
                <flex-col width="3" bg-color="bg-primary" justify="center">
                    <text>A</text>
                </flex-col>
                <flex-col width="6" bg-color="bg-info" justify="center">
                    <text>B</text>
                </flex-col>
                <flex-col width="2" bg-color="bg-primary" justify="center">
                    <text>C</text>
                </flex-col>
                <flex-col width="1" bg-color="bg-info" justify="center">
                    <text>D</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
           <flex-row h-style="margin-top: 30px;margin-bottom: 30px;">
                <flex-col offset="2" bg-color="bg-primary" justify="center">
                    <text>A</text>
                </flex-col>
                <flex-col offset="3" bg-color="bg-info" justify="center">
                    <text>B</text>
                </flex-col>
                <flex-col bg-color="bg-primary" justify="center">
                    <text>C</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row wrap="wrap" h-style="margin-top: 30px;margin-bottom: 30px;">
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>A</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-info" justify="center">
                    <text>B</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>C</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-info" justify="center">
                    <text>D</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>E</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row wrap="wrap-reverse" h-style="margin-top: 30px;margin-bottom: 30px;">
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>A</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-info" justify="center">
                    <text>B</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>C</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-info" justify="center">
                    <text>D</text>
                </flex-col>
                <flex-col width="4" bg-color="bg-primary" justify="center">
                    <text>E</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row h-style="margin-bottom: 20px;">
                <flex-col bg-color="bg-primary" justify="center" h-style="height: 100px;">
                    <text>A</text>
                </flex-col>
                <flex-col bg-color="bg-info" justify="center">
                    <text>默认对齐方式 -- stretch</text>
                </flex-col>
            </flex-row>
    
            <flex-row align="top" h-style="margin-bottom: 20px;">
                <flex-col bg-color="bg-primary" justify="center" h-style="height: 100px;">
                    <text>B</text>
                </flex-col>
                <flex-col bg-color="bg-info" justify="center">
                    <text>顶部对齐 -- top</text>
                </flex-col>
            </flex-row>
    
            <flex-row align="middle" h-style="margin-bottom: 20px;">
                <flex-col bg-color="bg-primary" justify="center" h-style="height: 100px;">
                    <text>C</text>
                </flex-col>
                <flex-col bg-color="bg-info" justify="center">
                    <text>居中对齐 -- middle</text>
                </flex-col>
            </flex-row>
    
            <flex-row align="bottom" h-style="margin-bottom: 20px;">
                <flex-col bg-color="bg-primary" justify="center" h-style="height: 100px;">
                    <text>D</text>
                </flex-col>
                <flex-col bg-color="bg-info" justify="center">
                    <text>底部对齐 -- bottom</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    <import name="flex-row" src="../Common/ui/h-ui/basic/c_flex_row"></import>
    <import name="flex-col" src="../Common/ui/h-ui/basic/c_flex_col"></import>
    <template>
        <div class="container">
            <flex-row h-style="margin-bottom: 20px;">
                <flex-col width="5" bg-color="bg-primary" justify="center">
                    <text>默认左对齐</text>
                </flex-col>
                <flex-col width="5" bg-color="bg-info" justify="center">
                    <text>left</text>
                </flex-col>
            </flex-row>
    
            <flex-row justify="right" h-style="margin-bottom: 20px;">
                <flex-col width="5" bg-color="bg-primary" justify="center">
                    <text>右对齐</text>
                </flex-col>
                <flex-col width="5" bg-color="bg-info" justify="center">
                    <text>right</text>
                </flex-col>
            </flex-row>
    
            <flex-row justify="center" h-style="margin-bottom: 20px;">
                <flex-col width="5" bg-color="bg-primary" justify="center">
                    <text>居中对齐</text>
                </flex-col>
                <flex-col width="5" bg-color="bg-info" justify="center">
                    <text>center</text>
                </flex-col>
            </flex-row>
    
            <flex-row justify="between" h-style="margin-bottom: 20px;">
                <flex-col width="5" bg-color="bg-primary" justify="center">
                    <text>两端对齐</text>
                </flex-col>
                <flex-col width="5" bg-color="bg-info" justify="center">
                    <text>between</text>
                </flex-col>
            </flex-row>
    
            <flex-row justify="around" h-style="margin-bottom: 20px;">
                <flex-col width="5" bg-color="bg-primary" justify="center">
                    <text>两侧的间隔相等</text>
                </flex-col>
                <flex-col width="5" bg-color="bg-info" justify="center">
                    <text>around</text>
                </flex-col>
            </flex-row>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
        .container text {
             color: #ffffff;
        }
    </style>
    

    扫码体验

  • 相关阅读:
    苹果 macOS 安装 Source Code Pro
    C# 中代码执行 ping 操作
    WPF 中 Path 使用虚线
    查看 Java Web 开发环境软件是 32 位还是 64 位
    linux 磁盘io监控
    Linux下系统如何监控服务器硬件、操作系统、应用服务和业务
    ORA-00257: archiver error. Connect internal only, until freed 错误的处理方法
    完全卸载oracle11g步骤
    用JDBC连接SQL Server2017数据库
    oracle INS-13001 环境不满足最低要求
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/Flex-dan-xing-bu-juzu-jianltflexrowgtltflexcolgt2.html
Copyright © 2020-2023  润新知