Problema centrado en subrayado del componente de pestañas antd-mobile

<Tabs 
            tabs={
    
    tabList}
            initialPage={
    
    0}
            // page={tabIndex}
            tabBarPosition="top"
            tabBarBackgroundColor={
    
    "transparent"}
            tabBarActiveTextColor={
    
    "#3A3A47"}
            tabBarInactiveTextColor={
    
    "#66666E"}
            tabBarTextStyle={
    
    {
    
    fontSize:'12px'}}
            tabBarUnderlineStyle={
    
    {
    
    width:'30px',marginLeft:'20px',background:'#1491ED'}}
            distanceToChangeTab={
    
    0.5}
            onTabClick={
    
    this.handleTabClick}
            renderTab={
    
    tab => <span>{
    
    tab.title}</span>}
          ></Tabs>

Inserte la descripción de la imagen aquí
Si necesita cambiar el estilo de subrayado, establezca directamente el ancho de tabBarUnderlineStyle en un ancho fijo y establezca un valor de margen izquierdo (punto clave)
porque el ancho div del subrayado es 100%. Si desea centrar, debe establecer el valor del margen izquierdo

Supongo que te gusta

Origin blog.csdn.net/sunzhen15896/article/details/110308404
Recomendado
Clasificación