vue-overflow-scroll

A Vue.js project
1,812
Install
npm install vue-overflow-scroll
Latest Version:1.1.4
Vue:2
License:MIT
Last Updated:Mar 29, 2018
Links: GitHub  ·  npm
Maintainer: jefferyliang

vue-overflow-scroll

Scroll automatically when the element is overflow.

support vue 2.0

live demo

Installation

NPM(recommended)

npm install vue-overflow-scroll -D


Get Started

// ES6
import Vue from 'vue'
import VueOverflowScroll from 'vue-overflow-scroll'

Vue.use(VueOverflowScroll)

Directive v-overflow-scroll then can be used in your Component.

<template>
  <div v-overflow-scroll="true" scroll-to="last-child">
    ...
  </div>
<template>
...

then when the div can scroll-y,then it can scroll to last child.

the scroll-to can scroll to other child like this option: scroll-to="first-child"、scroll-to="4"


if you want to scroll to the child dom by id, you can use scroll-to-id="child-dom-id"

<template>
  <div v-overflow-scroll="true" scroll-to-id="child-dom-id">
    ...
  </div>
</template>

if you wan to scroll to the child dom by class name, you can use scroll-to-class="child-dom-class-name"

<template>
  <div v-overflow-scroll="true" scroll-to-class="child-dom-class">
    ...
  </div>
</template>

Version History

Version Released Vue License
1.1.4 ^2.4.4 MIT
1.1.3 ^2.4.4 MIT
1.1.2 ^2.4.4 MIT
1.1.1 ^2.4.4 MIT
1.1.0 ^2.4.4 MIT