vue 选项卡

组件方式

<template>
  <div>
    <div class="bigbox">
      <div class="title">
        <div @click="tab(1)" :class="this.tabshow==1?'active':''">编制查询</div>
        <div @click="tab(2)" :class="this.tabshow==2?'active':''">JD负荷查询</div>
        <div @click="tab(3)" :class="this.tabshow==3?'active':''">承训负荷查询</div>
      </div>
      <hr />
      <div class="containerbox">
        <div v-show="tabshow==1">
         组件1/内容1
        </div>
        <div v-show="tabshow==2">
         组件2/内容2
        </div>
        <div v-show="tabshow==3">
          组件3/内容3
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tabshow: 3,
    };
  },
  created() {},
  methods: {
    tab(val) {
      this.tabshow=val
    },
  },
};
</script>
<style scoped>
.bigbox .title {
  display: flex;
}
.bigbox .title div {
  padding: 10px 40px;
  border: 1px solid rgb(104, 97, 97);
  cursor: pointer;
}
.containerbox {
}
.active {
  background-color: #000;
  color: #ffff;
}
html,body{
	scroll-behavior:smooth;
}
</style>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值