element-scroll

1.1.3 • Public • Published

vue environment. element-table

This package applies only to the element table.(Only silde. No mouse events)

requestAnimationFrame poor compatibility, mouse events will be updated later

Install

npm i element-scroll -S

Feature

Use H5-API requestAnimationFrame. Good performance, stable

Better than setTimeout/setInterval

Example

 import { scrollElement } from 'element-scroll';
 <el-table  height="300"ref="crud" stripe>
 </el-table>
  // vue2.0
  // You are advised not to use a function when determining the data length is small
  carousel() {
    const table = this.$refs.crud.bodyWrapper;
    const stopScroll = scrollElement(table, 1); // element step
    //stopScroll()  stop rolling...
    this.$once('hook:beforeDestroy', () => {
      stopScroll(); // Stop rolling when the component is about to be destroyed
    }); 
  },
  //  vue3.0 ...

Development

  • github is not configured.
  • This package is a test package

Readme

Keywords

none

Package Sidebar

Install

npm i element-scroll

Weekly Downloads

3

Version

1.1.3

License

ISC

Unpacked Size

1.73 kB

Total Files

3

Last publish

Collaborators

  • ltz0326