How to implement seamless scrolling components using vue

亚连
Release: 2018-06-20 13:50:56
Original
2032 people have browsed it

This article mainly explains the usage of vue's seamless scrolling component vue-seamless-scroll. Friends who need it can refer to it.

Installation

NPM

npm install vue-seamless-scroll --save
Copy after login

Usage

ES6

The following es6 usage requires webpack environment compilation.

  
Copy after login
import Vue from 'vue' import vueSeamlessScroll from 'vue-seamless-scroll' new Vue({ components: { vueSeamlessScroll } })
Copy after login

Normal mode (script tag)

Example:

      Document  

Copy after login
  ... 

Copy after login

Configure

defaultOption () { return { step: 1, //步长 越大滚动速度越快 limitMoveNum: 5, //启动无缝滚动最小数据量 this.dataList.length hoverStop: true, //是否启用鼠标hover控制 direction: 1, //1 往上 0 往下 openWatch: true, //开启data实时监听 singleHeight: 0, //单条数据高度有值hoverStop关闭 waitTime: 1000 //单步停止等待时间 } }
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Detailed interpretation of the responsiveness principle in Vuejs

About classes, constructors, and factory functions in Javascript How to use

How to use nodeJS to implement WeChat sharing

How to use the mobile component library in Vue.js (detailed tutorial)

How to remove the # sign from the url in Angular2 (detailed tutorial)

The above is the detailed content of How to implement seamless scrolling components using vue. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn