element-scroll
v1.1.3
Published
> vue environment. element-table
Downloads
5
Readme
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