sticky-footer使用

本文探讨了sticky-footer的多种实现方法,通过详细的代码示例,展示了如何在前端开发中创建固定底部布局,确保页面滚动时底部元素始终可见。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sticky-footer的几种实现方式

<template>
    <div class="header-detail" v-if="showDetail">
        <div class="detail-wrapper clearfix">
            <div class="detail-main">
              
            </div>
        </div>
        <div class="detail-close" @click='handleClickHide'>
           <i class="icon-close"></i>
        </div>
    </div>
</template>

<script>
export default {
  name: 'HeaderDetail',
  props: {
    showDetail: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleClickHide () {
      this.$emit('hide-detail')
    }
  }
}
</script>

<style lang="stylus" scoped>
    @import "~styles/stylus/mixin"
    @import "~styles/stylus/variable"
    .header-detail
        position: fixed
        z-index: 100
        top: 0
        left: 0
        width: 100%
        height: 100%
        overflow: auto 
        backdrop-filter: blur(10px)
        opacity: 1
        color: $color-white
        background: $color-background-s
        .detail-wrapper
          min-height: 100%
          .detail-main
            margin-top: 1.28rem
            padding-bottom: 1.28rem
        .detail-close
          position: relative
          width: .64rem
          height: .64rem
          margin: -1.28rem auto 0 auto 
          clear: both
          font-size: .64rem

</style>

.clearfix
  display: inline-block
  &:after
    display: block
    content: '.'
    height: 0
    line-height: 0
    clear: both
    visibility: hidden
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值