vue 滚动条平滑_Vue.js项目的平滑滚动条

vue 滚动条平滑

Vue平滑滚动条 (Vue Smooth Scrollbar)

Smooth Scrollbar for Vue.js projects. Based on @idiotwu's smooth-scrollbar.

Vue.js项目的平滑滚动条。 基于@idiotwu的平滑滚动条。

用法 (Usage)

1.安装依赖项 (1. Install dependency)

npm install --save vue-smooth-scrollbar

2.将组件导入main.js (2. Import component into main.js)

// src/main.js
import Vue from 'vue'
...
import SmoothScrollbar from 'vue-smooth-scrollbar'
Vue.use(SmoothScrollbar)
...

3.在模板中使用组件 (3. Use component in your templates)

<template>
  <div id="scroll-area">
    <smooth-scrollbar>
      <div id="example-content"></div>
    </smooth-scrollbar>
  </div>
</template>

<style>
  #scroll-area {
    width: 500px;
    height: 500px;
  }

  #example-content {
    width: 2000px;
    height: 2000px;
  }
</style>

积压 (Backlog)

  • [x] Plugin structure

    [x]插件结构

  • [x] Basic implementation

    [x]基本实施

  • [x] Options

    [x]选项

  • [ ] Events

    []活动

  • [x] Methods

    [x]方法

  • [ ] Styling

    []样式

  • [ ] Build dist

    []建立dist

  • [ ] SSR / nuxt

    [] SSR / nuxt

翻译自: https://vuejsexamples.com/smooth-scrollbar-for-vue-js-projects/

vue 滚动条平滑