Skip to content

Latest commit

 

History

History
88 lines (70 loc) · 2.49 KB

README_CN.md

File metadata and controls

88 lines (70 loc) · 2.49 KB

Vuejs-scroll-fixed-header Component

Build Status Github starts License Npm downloads Npm version

一 Vue 2 滑动固定头部组件

Demo 📙English Doc 📙更新日志

安装

npm i vuejs-scroll-fixed-header -S

使用

Support

支持包 版本
Vue 2.5+

引入组件

Javascript

// global register at main.js
import ScrollFixedHeader from 'vuejs-scroll-fixed-header'
Vue.use(ScrollFixedHeader)

Vue 使用

<template>
    <scroll-fixed-header :fixed.sync="fixed" :threshold="56">
        <nav class="navbar navbar-light bg-light">
          <div class="container">
            <a class="navbar-brand" href="#">
              Vuejs Scroll Fixed Header
            </a>
          </div>
        </nav>
    </scroll-fixed-header>
</template>

<script >
  export default {
    name: 'Timer',
    data() {
      return {
        fixed: false
      }
    }
  }
</script>

Props

name type default description
fixed Boolean false 当前头部的固定状态
threshold Number 0 距离scroll top触发固定状态的距离

Liscense

MIT License

Copyright (c) 2019 TriDiamond