頂部選項(xiàng)卡,與 ?Tabbar
? 類似,依賴? tab-item
?組件。
引入
import { Navbar, TabItem } from 'mint-ui';
Vue.component(Navbar.name, Navbar);
Vue.component(TabItem.name, TabItem);
例子
搭配 tab-container 組件使用
<mt-navbar v-model="selected">
<mt-tab-item id="1">選項(xiàng)一</mt-tab-item>
<mt-tab-item id="2">選項(xiàng)二</mt-tab-item>
<mt-tab-item id="3">選項(xiàng)三</mt-tab-item>
</mt-navbar>
<!-- tab-container -->
<mt-tab-container v-model="selected">
<mt-tab-container-item id="1">
<mt-cell v-for="n in 10" :title="'內(nèi)容 ' + n" />
</mt-tab-container-item>
<mt-tab-container-item id="2">
<mt-cell v-for="n in 4" :title="'測(cè)試 ' + n" />
</mt-tab-container-item>
<mt-tab-container-item id="3">
<mt-cell v-for="n in 6" :title="'選項(xiàng) ' + n" />
</mt-tab-container-item>
</mt-tab-container>
API
navbar
參數(shù) |
說(shuō)明 |
類型 |
可選值 |
默認(rèn)值 |
fixed |
固定在頁(yè)面頂部 |
Boolean |
|
false |
value |
返回當(dāng)前選中的 tab-item 的 id |
* |
|
|
tab-item
參數(shù) |
說(shuō)明 |
類型 |
可選值 |
默認(rèn)值 |
id |
選中后的返回值 |
* |
|
|
Slot
navbar
tab-item
name |
描述 |
- |
顯示文字 |
icon |
icon 圖標(biāo) |
更多建議: