用mint-ui tabber写餐厅分层

1.在页面中写个三层的tabber

 <!-- navbar -->  
    <mt-navbar class="page-part" v-model="selected">  
      <mt-tab-item id="1">一层</mt-tab-item>  
      <mt-tab-item id="2">二层</mt-tab-item>  
      <mt-tab-item id="3">三层</mt-tab-item>  
    </mt-navbar>  

2.当前选中第几层

  <div>  
      <mt-cell class="page-part" title="当前选中">{{ selected }}层</mt-cell>  
    </div>  

3.下面内容

<!-- tabcontainer -->  
    <mt-tab-container v-model="selected" class="restContent">  
      <mt-tab-container-item id="1" ><ul><li></li></ul></mt-tab-container-item>
    <mt-tab-container-item id="1" ><ul><li></li></ul></mt-tab-container-item>
    <mt-tab-container-item id="1"><ul><li></li></ul></mt-tab-container-item>
  </mt-tab-container> 
 

4.在data中定义selected,设置默认选中

selected: "1",
posted @ 2020-07-17 10:17  栗子米  阅读(180)  评论(0编辑  收藏  举报