# tabs

Tab component.

# install

npm install @ miniprogram-component-plus/tabs

On the page page.json in

// page.json
{
    "usingComponents": {
        "mp-tabs": @ miniprogram-component-plus/tabs"
    }
}

# Example

# List of properties

attribute type Default values Required Introductions
tabs Array [] yes The data item format is {title}
tab-class String no Tab Styles
swiper-class String no Content area swiper Style
active-class String no Check style
tab-underline-color String #07c160 no Underline color for selected items
tab-active-text-color String #000000 no Check font color
tab-inactive-text-color String #000000 no Unchecked font color
tab-background-color String #ffffff no Tab Background Color
active-tab Number 0 no to activate tab Indexes
duration Number 500 no Content area handoff duration
Bindtablick eventhandle no to hit tab When triggered, e.detail={index}
bindchange eventhandle no Content area scrolling causes tab Triggered upon change, and.detail={index}

# Note

  • Content Area Adoption <swiper>To scroll, the excess will be hidden, set the swiperClass Is the same height as the child element.
  • Content area child elements need to be specified slot=tab-content-indexWhere index Is the index of the tab (starting from 0).

# sample code

Preview with Developer Tool