https://github.com/beeplin/vue-keep-scroll-position
A vue 2.0 directive to keep scroll position for keep-alived components.
https://github.com/beeplin/vue-keep-scroll-position
Last synced: 8 months ago
JSON representation
A vue 2.0 directive to keep scroll position for keep-alived components.
- Host: GitHub
- URL: https://github.com/beeplin/vue-keep-scroll-position
- Owner: beeplin
- License: mit
- Created: 2016-10-29T08:16:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-06T06:20:41.000Z (over 9 years ago)
- Last Synced: 2025-10-21T02:52:09.292Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 39
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-keep-scroll-position
A vue 2.0 directive to keep scroll position for keep-alived components. Forked from [vue-keep-scroll](https://github.com/mark-hahn/vue-keep-scroll) and rewritten for vue 2.0 compatibility.
## Install
```bash
npm i -S vue-keep-scroll-position
```
## Plug into vue
```js
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 ``. For `router-view`:
```html
```
For simple dynamic components:
```html
```