您好,欢迎来到五一七教育网。
搜索
您的当前位置:首页Segmented Button 的应用

Segmented Button 的应用

来源:五一七教育网

Segmented Button 常被用作工具条、导航栏,默认为单选切换,如果想实现多选,只需设置allowMultiple属性为true。

JS:

{
    xtype: 'container',
    items: [{
            xtype: 'segmentedbutton',
            allowMultiple: true,
            layout: 'hbox',
            cls: 'segBtns',
            defaults: {
                ui: 'plain',
                cls: 'btn'
            },
            items: [{
                    text: '爱情',
                    flex: 1,
                    pressed: true
                },
                {
                    text: '事业',
                    flex: 1
                },
                {
                    text: '梦想',
                    flex: 1
                },
            ],
            listeners: {
                element: 'element',
                toggle: {
                    fn: function(container, button, pressed) {
                        alert();
                    }
                }
            }
        }

    ],
}

 

CSS:

.segBtns .btn{
    color: white;
    border-radius: 0px;
    background: #0E4A75;
}
.segBtns .btn.x-button-pressed{
    background: yellow;
    color: red;
}

 2.在app.json,bootstrap.json中引入自定义css。

 

转载于:https://www.cnblogs.com/quhongxin/p/6747711.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务