vue-keep-scroll-position

A vue 2.0 directive to keep scroll position for keep-alived components.
17,100 39
Install
npm install vue-keep-scroll-position
Latest Version:0.1.2
License:MIT
Last Updated:Nov 6, 2016
Links: GitHub  ·  npm
Maintainer: beeplin

vue-keep-scroll-position

A vue 2.0 directive to keep scroll position for keep-alived components. Forked from vue-keep-scroll and rewritten for vue 2.0 compatibility.

Install

npm i -S vue-keep-scroll-position

Plug into vue

import Vue from 'vue'
import VueKeepScrollPosition from 'vue-keep-scroll-position'
Vue.use VueKeepScrollPosition

Usage

Just add v-keep-scroll-position to your components within <keep-alive>. For router-view:

<keep-alive>
  <router-view v-keep-scroll-position></router-view>
</keep-alive>

For simple dynamic components:

<keep-alive>
  <component :is="someComponentName" v-keep-scroll-position></component>
</keep-alive>

Related Packages

position-indicator

position indicator library

9,230 3
vue-check-view

Simple vue plugin that checks element position on screen (viewport) and adds cla...

99,472 112
easyscroll

this is a tiny scroll bar plugin for vue2.0

871 41
vue-dragscroll

vue directive to make a scrollable element scroll by draging to the scroll direc...

1,541,547 264
vue3-smooth-scroll

Simple vue smooth scroll

209,775 34

Version History

Version Released License
0.1.2 MIT
0.1.1 MIT
0.1.0 MIT