vue tab切换
<template>
<div class="box">
<ul>
<li v-for="(item,index) in arrText" :key="index" @click="tab(index)" :class='{active:index===num}'>{{item}}</li>
</ul>
<div class="text">
<p v-for="(items,index) in arrConten" :key="index" v-show="index===num">{{items}}</p>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'planning',
data () {
return {
arrText: ['月落', '乌啼', '霜满天', '江枫', '渔火', '对愁眠'],
arrConten: ['月上柳枝头', '乌鸦啼血猿哀鸣', '霜叶红于二月花', '一江春水向东流','授人以鱼不如授人以渔', '春眠不觉晓'],
num: 0
}
},
methods: {
tab (val) {
console.log(val)
this.num = val
}
}
}
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
ul
display flex
justify-content space-around
margin-top 1rem
font-size 0.3rem
li
// background pink
color #8B008B
padding 5px
text-align center
border-radius 3px
cursor pointer
width 17%
.active
color #C67171
border-bottom 2px solid #C67171
// background #C0FF3E
.text
width 100%
height 300px
border 1px solid #ff3341
margin-top 0.5rem
padding 1rem
font-size 0.3rem
</style>
vue tab切换的更多相关文章
- vue tab切换demo
定义tab页面切换的内容 var app=new Vue({ el:'#app', data:{ navTabs:[ { text:"tab1", isActive:true, t ...
- vue tab切换布局
页面 功能 点击tab1和tab2,content内容切换content1和content2 <template> <div> <div class="tab& ...
- vue实现tab切换功能
最近用vue做一个页面的tab功能,经过一查找资料,没用路由,也没用动态组件,完美实现了tab切换功能,效果如下 下面是代码实现,这是模板 <article id="example&q ...
- vue 实现tab切换动态加载不同的组件
vue 实现tab切换动态加载不同的组件 使用vue中的is特性来加载不同的组件.具体看如下代码:这个功能对于vue比较复杂的页面可以使用上,可以把一个页面的功能拆分出来,使代码更简单.使用方式具体看 ...
- vue.cli实现tab切换效果
<template> <div class="cp-select"> <div class="lef ...
- vue + element-ui 制作tab切换(切换vue组件,踩坑总结)
本篇文章使用vue结合element-ui开发tab切换vue的不同组件,每一个tab切换的都是一个新的组件. 1.vue如何使用element-ui 上一篇文章已经分享了如何在vue中使用eleme ...
- VUE 实现tab切换页面效果
一 163邮箱登录tab切换 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...
- vue + element-ui 制作tab切换(适用于单页切换不同标记显示不同内容)
本篇文章使用vue结合element开发tab切换单页不同的标记显示不同的内容. 1.安装element-ui npm install element-ui --save 2.在main.js中引入e ...
- vue实现tab切换
需要弄类似tab切换的功能就是一个点击切换上一页下一页的页面 找到这个获得灵感 <!DOCTYPE html> <html lang="en"> <h ...
随机推荐
- (笨方法)利用stat函数实现ls -l filename
学习了一段时间的Linux了,但是我感觉我做不出来啥子,后头选择利用系统IO函数实现命令,先从ls走起吧.先来看看ls -l filename给我们显示了什么吧 : 可以看到,一共八项:文件类型.用户 ...
- easy.py使用中ValueError: could not convert string to float: svm_options错误问题解决
在使用easy.py中出现如下图所示问题 解决方法: 1.找到cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{ ...
- 树莓派安装centos7
引用:https://blog.csdn.net/elesos/article/details/80514659 1,格式化 https://www.sdcard.org/downloads/form ...
- Object-c 调用unity的 UIViewController和UnitySendMessage
.mm文件中实现 #import <UIKit/UIKit.h> extern UIViewController *UnityGetGLViewController(); extern & ...
- 最邻近算法(KNN)识别数字验证码
应用场景 对于简单的数字型验证码的自动识别.前期已经完成的工作是通过切割将验证码图片切割成一个一个的单个数字的图片,并按照对应的数字表征类别进行分类(即哪些图片表示数字7,哪些表示8),将各种数字 ...
- Working with the Dynamic Type in C#
Working with the Dynamic Type in C# https://www.red-gate.com/simple-talk/dotnet/c-programming/workin ...
- Asp.Net WebApi 学习记录(一)
刚创建的 Asp.Net Web Api 项目,在进行简单的测试时发现返回的 JSON 数据很丑陋.与平时我们使用的 JSON.NET 序列化出来的字符串不一样.通过下面的设置就可以了: // 清除所 ...
- 学习JS的心路历程-类型
前言 之前学JS时候都是靠着谷狗一路跌跌撞撞的学过来,从来没有去翻过MDN的文件,导致留了许多技术债给自己. 最近有幸遇到一位前辈并开始从头学JS,前辈表示学程序不看文件是想作死自己?于是我的第一份功 ...
- godep 包管理
go get -u -v github.com/tools/godep godep save
- Linux切换工作目录命令:cd
cd [语法]cd[目录路径][详解]cd指令用于在不同目录间进行切换,前提下该帐号要有这个目录的权限.如果直接输入cd,并省略目录名,则会自动切换到用户根目录下.[参数] 选项 相应功能 目录路径 ...