Skip to content

Simple and cross-browser friendly fixed header component for Vue.js written by TypeScript.

License

Notifications You must be signed in to change notification settings

potato4d/vue-fixed-header

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Fixed Header

NPM version NPM downloads CircleCI

Simple and cross-browser friendly fixed header component for Vue.js.

8d82f81b0f64d044ada918a7b9f3c574

Install

yarn add vue-fixed-header

Usage

<template>
  <fixed-header :fixed.sync="isFixed">
    <div :class="{ 'is-fixed': isFixed }">
      Your Content
    </div>
  </fixed-header>
</template>

<script>
import FixedHeader from 'vue-fixed-header'

export default {
  components: {
    FixedHeader
  },
  data () {
    return {
      isFixed: false
    }
  }
}
</script>

Props

threshold: Number

The threshold value for determining the scroll state.

<template>
  <fixed-header :fixed.sync="isFixed" :threshold="100">
    <div :class="{ 'is-fixed': isFixed }">
      Your Content
    </div>
  </fixed-header>
</template>

<script>
import FixedHeader from 'vue-fixed-header'

export default {
  components: {
    FixedHeader
  },
  data () {
    return {
      isFixed: false
    }
  }
}
</script>

License

MIT © potato4d

About

Simple and cross-browser friendly fixed header component for Vue.js written by TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published