This is an overview of the most common usage of SegmentedBar. For more information about the available properties, methods, or events, head over to the complete API documentation for SegmentedBar.
<SegmentedBar>
is a UI bar component that displays a set of buttons for discrete selection. Can show text or images.
As opposed to <TabView>
:
<SegmentedBar>
is not fixed.<SegmentedBar>
<SegmentedBarItem title="First" />
<SegmentedBarItem title="Second" />
<SegmentedBarItem title="Third" />
</SegmentedBar>
<SegmentedBar :items="listOfItems" selectedIndex="0"
@selectedIndexChange="onSelectedIndexChange" />
<SegmentedBar>
provides two-way data binding using v-model
.
<SegmentedBar :items="listOfItems" v-model="selectedItem" />
Name | Type | Description |
---|---|---|
items | Array<SegmentedBarItem> | An array of items to be displayed in the segmented bar. Represents the button labels or icons of the segmented bar. The array must be created in advance. |
selectedIndex | Number | Gets or sets the index of the selected item. |
selectedBackgroundColor | Color | (Style property) Gets or sets the background color of the selected item. To set the background color of the entire bar, use backgroundColor . |
Name | Description |
---|---|
selectedIndexChange | Emitted when the an item on the segmented bar is tapped. |
Android | iOS |
---|---|
android.widget.TabHost | UISegmentedControl |