小菜2878
小菜2878
  • 发布:2018-12-29 16:01
  • 更新:2019-01-02 12:39
  • 阅读:2235

SegmentedControl 如何分别定义字体颜色,以及边框、背景

分类:uni-app

怎么样写,才能分别定义字体颜色、背景颜色。。以及选中后的效果,求教!

2018-12-29 16:01 负责人:无 分享
已邀请:
虫雪浓

虫雪浓 - 热爱生活,热爱编程

可以在组件 uni-segmented-control.vue中修改相关代码 。

activeStyle() {  
    let styleString = '';  
    switch (this.styleType) {  
        case 'text':  
        styleString = `color:${this.activeColor};border-left:0;border-bottom-style:solid;`;  
        break;  
        default:  
        styleString = `color:#fff;border-color:${this.activeColor};background-color:${this.activeColor}`;  
        break;  
    }  
    return styleString;  
}

该问题目前已经被锁定, 无法添加新回复