vue 向上展开和收起

<template>
  <div class="top">
    <div class="container" v-show="isShow">
      <p>寒雨连江夜入吴</p>
      <p>平明送客楚山孤</p>
      <p>洛阳亲友如相问</p>
      <p>一片冰心在玉壶</p>
      <p>一片冰心在玉壶</p>
      <p>一片冰心在玉壶</p>
    </div>
    <div class="title">
      <div @click="btn" style="cursor: pointer">
        已选择0个ELR
        <span class="btn">
          <a-icon type="down" v-if="isShow" />
          <a-icon type="up" v-else />
        
        </span>
      </div>
      <a-button type="primary"> 立即下单 </a-button>
    </div>
  </div>
</template>
<script>
export default {
  name: "App",
  components: {},
  data() {
    return {
      isShow: false,
    };
  },
  methods: {
    btn() {
      this.isShow = !this.isShow;
    },
  },
};
</script>

<style lang="scss" scoped>
.top{
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50px;
  background-color: #fafafa;
  border: 2px solid #d9d9d9;
  border-radius: 5px;
  line-height: 50px;
  .title {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .container {
    width: 100%;
    position: absolute;
    bottom: 50px;
    border-radius: 5px;
    border: 2px solid #015a9c;
    background-color: #ccc;
  }
  .btn {
    margin-left: 5px;
    margin-right: 10px;
    cursor: pointer;
  }
}
</style>

效果图收起

 

 效果图展开

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值