<template>
<Poptip trigger="hover" title="Title" content="content">
<i-button>Hover</i-button>
</Poptip>
<Poptip trigger="hover" title="Title" content="content">
<i-button>Hover</i-button>
</Poptip>
<Poptip trigger="hover" title="Title" content="content">
<i-button>Hover</i-button>
</Poptip>
<Poptip trigger="hover" title="Title" content="content">
<i-button>Hover</i-button>
</Poptip>
<Poptip title="" content="content">
<i-button>筛选</i-button>
<div class="api" slot="content">
<Tabs :animated="false" v-model="currentTab" @on-click="currentTabChanged">
<tab-pane label="学院" name="xy">
<i-row v-for="item in xyList" @click='showZy(item)'>
<i-col span="12" class="xy" :class="{'selectedColor':flag1==item.id}">
{{item.label}}
</i-col>
</i-row>
</tab-pane>
<tab-pane label="专业" name="zy" v-if="show2">
<i-row v-for="item in xyList.zy" @click="showList(item)">
<i-col span="12" class="xy" :class="{'selectedColor':flag2==item.id}">
{{item.label}}
</i-col>
</i-row>
</tab-pane>
</Tabs>
</div>
</Poptip>
</template>
<script>
export default {
data() {
return {
currentTab: 'xy',
show2: false,
flag1: -1,
flag2: -1,
xyList: [{
value: 'renwen',
id: 1,
label: '马克思主义学院',
zy: [{
value: 'xinxi',
id: 1,
label: '马克思'
},
{
value: 'gongcheng',
id: 2,
label: '马克思'
},
{
value: 'tongxin',
id: 3,
label: '马克思'
}
]
},
{
value: 'dili',
id: 2,
label: '地理信息科学技术学院',
zy: [{
value: 'xinxi',
id: 1,
label: '地理'
},
{
value: 'gongcheng',
id: 2,
label: '地理'
},
{
value: 'tongxin',
id: 3,
label: '地理'
}
]
},
{
value: 'sheke',
id: 3,
label: '社科',
zy: [{
value: 'xinxi',
id: 1,
label: '社科'
},
{
value: 'gongcheng',
id: 2,
label: '社科'
},
{
value: 'tongxin',
id: 3,
label: '社科'
}
]
},
{
value: 'renwen',
id: 4,
label: '人文',
zy: [{
value: 'xinxi',
id: 1,
label: '人文'
},
{
value: 'gongcheng',
id: 2,
label: '人文'
},
{
value: 'tongxin',
id: 3,
label: '人文'
}
]
},
{
value: 'dili',
id: 5,
label: '地理',
zy: [{
value: 'xinxi',
id: 1,
label: '地理'
},
{
value: 'gongcheng',
id: 2,
label: '地理'
},
{
value: 'tongxin',
id: 3,
label: '地理'
}
]
},
{
value: 'sheke',
id: 6,
label: '社科',
zy: [{
value: 'xinxi',
id: 1,
label: '社科'
},
{
value: 'gongcheng',
id: 2,
label: '社科'
},
{
value: 'tongxin',
id: 3,
label: '社科'
}
]
}
]
}
},
methods: {
currentTabChanged(name) {
if(this.currentTab == 'xy'){
// this.show2 = false
}
},
showZy(item) {
if (item.label) {
this.flag1 = item.id
this.xyList.zy = item.zy
this.show2 = true
this.currentTab = 'zy'
// console.log(this.xyList.zy)
}
},
showList(item) {
if (item.label) {
this.flag2 = item.id
// console.log(item.label)
}
}
}
}
</script> <style>
span {
padding: 10px;
cursor: pointer;
} .xy {
cursor: pointer;
padding: 5px;
box-sizing: border-box;
} .selectedColor {
color: #2d8cf0;
}
</style>

复制以上代码到 run ivew 网站预览效果

最新文章

  1. C#如何使用Soap协议调用WebService?
  2. 为什么接口类型可以直接new?
  3. HTML &lt;!DOCTYPE&gt; Declaration
  4. SQL语句的基础
  5. linux工具之putty
  6. js函数延迟执行
  7. DrawDib函数组的使用
  8. Python天天美味(15) - Python正则表达式操作指南(re使用)(转)
  9. Educational Codeforces Round 6 D. Professor GukiZ and Two Arrays
  10. 【Java基础01】Java InputStream的read方法
  11. HTML+CSS基础学习笔记(2)
  12. Kendo UI开发教程(26): 单页面应用(四) Layout
  13. DirectX 9 UI三种设计学习笔记:文章4章Introducing DirectInput+文章5章Wrapping Direct3D
  14. js获取光标位置
  15. 在Windows下安装redis扩展和memcached扩展
  16. 安装 CentOS 时, BIOS 设置界面,找不到虚拟镜像
  17. projective dynamics的global solve中 引入拉格朗日乘子的简化方法
  18. Confluence 6 修改日志文件的目标位置
  19. java程序连接oracle12c报:java.sql.SQLException: ORA-28040: 没有匹配的验证协议。
  20. Mac系统安装和配置tomcat步骤详解

热门文章

  1. 【BZOJ1578】【USACO2009Feb】股票市场 背包DP
  2. bzoj 1015: [JSOI2008]星球大战starwar (逆向思维+并查集)
  3. npm 常规错误
  4. 【POJ1037】A decorative fence(DP)
  5. 【luogu3733】【HAOI2017】 八纵八横 (线段树分治+线性基)
  6. 【bzoj3456】城市规划(多项式求逆+dp)
  7. BZOJ 4242: 水壶(Kruskal重构树 + Bfs)
  8. Hdoj 1856.More is better 题解
  9. NOIP2008双栈排序(贪心)
  10. webRequest封装