@codekraft-studio/vue-autoscroll

0.1.1 • Public • Published

vue-autoscroll

Automatic scroll-down directive for VueJs

DEMO

Installation

Install the project locally using your favourite package manager.

npm install @codekraft-studio/vue-autoscroll

Register the plugin in your Vue application.

import Vue from 'vue'
import VueAutoscroll from '@codekraft-studio/vue-autoscroll'

Vue.use(VueAutoscroll)

Than place the directive on the container you want to scroll automatically.

<ul class="messages-container" v-autoscroll>
  <li v-for="message in messages" v-text="message" class="message"></li>
</ul>

You can also use custom scroll settings.

<ul class="messages-container" v-autoscroll="{ smooth: false, always: true }">
  <li v-for="message in messages" v-text="message" class="message"></li>
</ul>

If you have a complicate html structure and you need to watch also for grandchildrens and more, you can use the deep modifier.

<div v-autoscroll.deep>
  <div v-for="(entries, key) in groupedEntries">
    <div>{{key}}</div>
    <div v-for="entry in entries">{{entry}}</div>
  </div>
</div>

License

Released with MIT License © codekraft-studio

Readme

Keywords

none

Package Sidebar

Install

npm i @codekraft-studio/vue-autoscroll

Weekly Downloads

12

Version

0.1.1

License

none

Unpacked Size

724 kB

Total Files

31

Last publish

Collaborators

  • erikyo
  • b4dnewz