首页 > 其他分享 >vue tab切换滑动门

vue tab切换滑动门

时间:2024-04-24 11:13:41浏览次数:12  
标签:vue tab 2.7 height background rem 滑动门 border &-

<script setup lang="ts">
import {ref} from "vue";

const selectName = ref('技术指标及标准')
const nacigation = ref([ '技术指标及标准', '文献著作', '报告模版', '专家库/项目库',])
</script>

<template>
<div class="epd-box-bagColor">
<div class="epd-box">
<div class="epd-box-center">

<div class="epd-box-center-navigation">
<div @click="selectName = item" v-for="(item, index) in nacigation" :key="index" :class="{'epd-box-center-navigation-item': true, 'epd-box-center-navigation-selectItem': item === selectName}">
{{ item }}
</div>
<div :style="{'left': (nacigation.indexOf(selectName) * 14.5) + 'rem'}" class="epd-box-center-navigation-tab-active" >
<div class="epd-box-center-navigation-tab-active-footer" />
</div>
</div>

</div>
</div>
</div>
</template>

<style scoped lang="less">
.epd-box-bagColor {
background: #F6FAFF;
}
.epd-box {
padding-top: 2.7rem;
background-size: 100% 26.8rem !important;
background: url("@/assets/images/EPD/EPDBackground4.png") no-repeat;
&-center {
padding: 2.7rem 1.8rem 0 2.4rem;
width: 62.5rem;
min-height: 48rem;
background: #FFFFFF;
border-radius: 0.5rem;
margin: 0 auto 2.1rem auto;

&-navigation {
display: flex;
position: relative;
background: #F5F7FA;
color: #9E9E9E;
border-radius: 0.3rem;
&-item {
z-index: 2;
cursor: pointer;
width: 14.5rem;
height: 2.7rem;
font-weight: 500;
font-size: @epd-fontSize-middle;
line-height: 2.7rem;
text-align: center;
position: relative;
}
&-selectItem {
color: #fff;
transition: color 0.4s;
}
&-tab-active {
z-index: 1;
position: absolute;
bottom: 0;
width: 14.5rem;
height: 2.7rem;
display: inline-block;
background: #2F9CF1;
border-radius: 0.3rem;
transition: left .4s; /* 针对 left 变动来实现动画 */
&-footer {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 0.5rem solid transparent;
border-right: 0.5rem solid transparent;
border-bottom: 0.6rem solid #fff;
}
}
}
}
}
</style>

 

标签:vue,tab,2.7,height,background,rem,滑动门,border,&-
From: https://www.cnblogs.com/echowwy/p/18154626

相关文章

  • 前端在浏览器显示摄像头传回的RTSP视频流,前端采用的技术有VUE+video.js+flv.js
    在前端使用Vue.js框架,结合video.js和flv.js播放RTSP视频流,需要经过一系列步骤,因为浏览器并不能直接播放RTSP流,所以通常需要一个服务器来将RTSP流转为HLS或FLV格式,然后前端再通过flv.js播放。以下是一个基于此思路的基本实现指南:确保你已经安装了Vue.js、video.js、flv.js相关的依......
  • Vue路由传值-路由组件传值
    在路由配置中设置需要传递参数的路由,并在路由路径中定义参数占位符:点击查看代码constroutes=[{path:'/user/:id',name:'user',component:UserComponent}];在触发路由跳转时,通过router.push方法传递参数:点击查看代码this.$router.push(......
  • vue生命周期
    生命周期1是什么:Vue在关键时刻帮我们调研员的一些特殊名称的函数2生命周期的函数名字是不可更改3生命周期函数的this指向是vm或组件的实例对象mounted挂载Vue完成模版的解析并把初始的真实DOM元素放入页面后(挂载完毕)调用mounted页面中呈现的是经过Vue编译的DOM。对......
  • docker compose 部署MetaBase,非常好用的BI工具
    docker-compose部署MetabaseMetabase官网:MetaBase部署步骤docker-compose文件准备docker-compose.ymlversion:'3.9'services:metabase:image:metabase/metabase:latestcontainer_name:metabasehostname:metabasevolumes:-/dev/ur......
  • C# 将DataTable 导出 CSV
    完整代码publicstaticbooldataTableToCsv(DataTabletable,stringfile){try{stringtitle="";FileStreamfs=newFileStream(file,FileMode.OpenOrCreate);//File......
  • C# 将DataTable 导出 Excel
    首先引用 Excel完整代码//速度最快///<summary>///将数据集中的数据导出到EXCEL文件///</summary>///<paramname="dataTable">输入数据集</param>///<paramname="isShowExcle">是否......
  • element-ui 合并行或列 table :span-method(行合并)
    element-ui官网案例:table合并行或列 element-ui官网中关于行合并的例子是根据行号进行合并的,这显然不符合我们日常开发需求,因为通常我们table中的数据都是动态生成的,所以需要做一些修改。我们首先解读一下官网实例中的各参数的意义:objectSpanMethod({row,column,rowInde......
  • Stable Diffusion中的常用术语解析
    StableDiffusion中的常用术语解析对于很多初学者来说,会对StableDiffusion中的很多术语感到困惑,当然你不是唯一的那个。在这篇文章中,我将会讲解几乎所有你在StableDiffusion中需要了解的关键术语。搞懂了这些术语,使用stablediffusion起来就会事半功倍。4x-Ultrasharp4x-Ult......
  • table固定表头和列 css实现表格固定表头
    Hello,大家好,我是站长鹏仔,本次鹏仔开发的项目中,实现出功能如图所示,固定表格的头部和左侧,在超出时滚动条滚动悬浮,之前给大家写过一次表格表头固定,是用占位的方式(https://www.sharedbk.com/post/178.html),太麻烦了,本次给大家分享一个更简单的方法。本次主要用到的css属性是粘性定位......
  • uview2 tabs左右滑动切换
    首先思路:在滑动区域监听事件,记录用户的起始位置,根据用户滑动的坐标判断出用户操作。<viewclass="body"@touchstart="touchStart"@touchmove="touchMove"@touchend="touchEnd">新增三个事件,用于监听用户操作touchStart(event){//记录触摸起始点的横坐......