navbar的具体实现

 <template>
<div class="page-navbar">
<div class="page-title">Navbar</div>
<!-- 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> <div>
<mt-cell class="page-part" title="当前选中">{{ selected }}</mt-cell>
</div> <!-- tabcontainer -->
<mt-tab-container v-model="selected">
<mt-tab-container-item id="1">
<mt-cell v-for="n in 10" :title="'内容 ' + n" />
</mt-tab-container-item>
<mt-tab-container-item id="2">
<mt-cell v-for="n in 4" :title="'测试 ' + n" />
</mt-tab-container-item>
<mt-tab-container-item id="3">
<mt-cell v-for="n in 6" :title="'选项 ' + n" />
</mt-tab-container-item>
</mt-tab-container>
</div>
</template> <script>
export default {
name: 'page-navbar', data() {
return {
selected: '1'
};
}
};
</script>

navbar.vue

Import

按需引入:

import { Navbar, TabItem } from 'mint-ui';

Vue.component(Navbar.name, Navbar);

Vue.component(TabItem.name, TabItem);

全局导入:全局导入后不用再导入

importMintfrom'mint-ui'

import'mint-ui/lib/style.css'

Vue.use(Mint);

API

API

navbar

参数 说明 类型 可选值 默认值
fixed 固定在页面顶部 Boolean   false
value 返回当前选中的 tab-item 的 id *    

tab-item

参数 说明 类型 可选值 默认值
id 选中后的返回值 *    

Slot

navbar

name 描述
- 内容

tab-item

name 描述
- 显示文字
icon icon 图标

show:

点击选项二

navbar是选项卡之间的切换,可以更改切换后选项卡的样式,因为每一个激活后都会有一个mint-tab-item is-selected的一个类,显示被激活,而tab-container是按钮之间的切换,可以有左右滑动的特效,具体实现如下:

tab-container的具体实现

面板,可切换显示子页面。

常与navbar、tabbar结合使用

 <template>
<div>
<div class="nav">
<mt-button size="small" @click.native.prevent="active = 'tab-container1'">tab 1</mt-button>
<mt-button size="small" @click.native.prevent="active = 'tab-container2'">tab 2</mt-button>
<mt-button size="small" @click.native.prevent="active = 'tab-container3'">tab 3</mt-button>
</div> <div class="page-tab-container">
<mt-tab-container class="page-tabbar-tab-container" v-model="active" swipeable>
<mt-tab-container-item id="tab-container1">
<!-- cell组件 -->
<mt-cell v-for="n in 10" title="tab-container 1"></mt-cell>
</mt-tab-container-item>
<mt-tab-container-item id="tab-container2">
<!-- cell组件 -->
<mt-cell v-for="n in 5" title="tab-container 2"></mt-cell>
</mt-tab-container-item>
<mt-tab-container-item id="tab-container3">
<!-- cell组件 -->
<mt-cell v-for="n in 7" title="tab-container 3"></mt-cell>
</mt-tab-container-item>
</mt-tab-container>
</div>
</div>
</template> <script>
export default {
name: 'page-tab-container',
data() {
return {
active: 'tab-container1'
};
}
};
</script> <style lang="css" scoped>
.item {
display: inline-block;
} .nav {
padding: 10px;
} .link {
color: inherit;
padding: 20px;
display: block;
}
</style>

tab-container.vue

Import

按需引入:

import { TabContainer, TabContainerItem } from 'mint-ui';

Vue.component(TabContainer.name, TabContainer);

Vue.component(TabContainerItem.name, TabContainerItem);

全局导入:全局导入后不用再导入

importMintfrom'mint-ui'

import'mint-ui/lib/style.css'

Vue.use(Mint);

API

API

tab-container

参数 说明 类型 可选值 默认值
value 当前激活的 id *    
swipeable 显示滑动效果 Boolean   false

tab-container-item

参数 说明 类型 可选值 默认值
id item 的 id *    

Slot

tab-container

name 描述
- 内容

tab-container-item

name 描述
- 内容

show

mint-ui —— navbar和tab-container的区别的更多相关文章

  1. vue mint ui 手册文档对于墙的恐惧

    http://www.cnblogs.com/smallteeth/p/6901610.html npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm ...

  2. vue mint ui 手册文档

    npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm i mint-ui -S CDN 目前可以通过 unpkg.com/mint-ui 获取到最新版本 ...

  3. vue mint UI

    vue 与mint  UI 结合开发手机app  html5页面 api  文档   http://mint-ui.github.io/#!/zh-cn

  4. ElementUI(vue UI库)、iView(vue UI库)、ant design(react UI库)中组件的区别

    ElementUI(vue UI库).iView(vue UI库).ant design(react UI库)中组件的区别: 事项 ElementUI iView ant design 全局加载进度条 ...

  5. 基于VUE.JS的移动端框架Mint UI

    Mint UI GitHub:github.com/ElemeFE/mint 项目主页:mint-ui.github.io/# Demo:elemefe.github.io/mint- 文档:mint ...

  6. Mint UI文档

    Mint UI文档:http://elemefe.github.io/mint-ui/#/ 一.Mint UI的安装和基本用法. 1.NPM :npm i mint-ui -S 建议使用npm进行安装 ...

  7. 新建一个基于vue.js+Mint UI的项目

    上篇文章里面讲到如何新建一个基于vue,js的项目(详细文章请戳用Vue创建一个新的项目). 该项目如果需要组件等都需要自己去写,今天就学习一下如何新建一个基于vue.js+Mint UI的项目,直接 ...

  8. iView webapp / Mint UI / MUI [前端UI]

    前端UI iView webapp一套高质量的 微信小程序 UI 组件库 https://weapp.iviewui.com/?from=iview Mint UI 基于 Vue.js 的移动端组件库 ...

  9. Mint UI 使用指南

    上来直接在webpack里将Mint UI引入项目,发现各种问题.饿了么组件库文档太坑了,好多地方写错,有些该说明的地方没说,比如例子里单文件.vue组件里用的类post-css处理器,我一直使用SA ...

  10. Mint UI Example的运行

    Mint -UI是新推出的移动端UI框架 官网 不过官网上的文档例子不是很全面. 建议下载他们提供的example来学习. 1.examplle源码下载地址 2.打开项目,我这里使用webstorm, ...

随机推荐

  1. JavaScript一个函数式编程-------求标准差

    利用JavaScript中的map函数和reduce函数实现函数式编程. 注意: 输出都在浏览器的控制台中. 代码如下: <script type="text/javascript&q ...

  2. spring boot controller路由 url 扫描不到问题

    spring boot项目出现controller的路由没被注册,原因:启动类application跟controller不在一个包中,扫描不到controller, 如启动类在com.oyx.a,c ...

  3. JS - 实现简单易用的倒计时 x 天 x 时 x 分 x 秒

    <script> (function () { var tian = document.getElementsByClassName('JS-tian')[0]; var shi = do ...

  4. python cookbook第三版学习笔记十二:类和对象(三)创建新的类或实例属性

    先介绍几个类中的应用__getattr__,__setattr__,__get__,__set__,__getattribute__,. __getattr__:当在类中找不到attribute的时候 ...

  5. poj_3468: A Simple Problem with Integers (树状数组区间更新)

    题目是对一个数组,支持两种操作 操作C:对下标从a到b的每个元素,值增加c: 操作Q:对求下标从a到b的元素值之和. 这道题也可以用线段树解,本文不做描述,下面分析如何用树状数组来解决这道题. 先把问 ...

  6. maven:pom.xml中没有dependency标签错误

    dependency的标签是包含在dependencies中的.

  7. date——sql查询

    场景:在数据库中要删除一条记录,但是该记录的唯一性只能通过插入数据库的系统时间来确定,字段为date类型,格式是:2016/10/19 17:17:29. 1 解决 在百度上找到的方法是使用to_ch ...

  8. cin问题 分类: c++ 2014-08-02 21:13 38人阅读 评论(0) 收藏

    string s: while(cin>>s){ cout<<s<endl; } 当输入ss w    ww   w   w 按enter时 输出为 ss w ww w ...

  9. 二.GC相关之Java内存模型

    根据上节描述的问题,我们知道其最终原因是GC导致的.本节我们就先详细探讨下与GC息息相关的Java内存模型. 名词解释:变量,理解为java的基本类型.对象,理解为java new出来的实例. Jav ...

  10. 我的学习之路_第三十四章_jsp

    jsp 在只有servlet时,输出页面内容比较麻烦(成本高,java代码中输出HTML标签),所以需要一种技术,主要是HTML页面的代码(HTML,css,js),可以嵌入java代码,来实现动态页 ...