vuepress-theme-vuescroll - 可以自定义在vuepress里自定义滚动条

2,299 阅读1分钟
原文链接: github.com

Introduction

vuepress-theme-vuescroll is a vuepress theme plugin that allow you customize scrollbars by vuescroll in Vuepress.

Who use this plugin ?

Usage

  1. Installation
  npm i vuepress-theme-vuescroll -S
  1. Config.js

To use a theme from an npm dependency, provide a theme option in .vuepress/config.js:

module.exports = {
  theme: 'vuescroll'
};
  1. Create an enhanceApp.js in your .vuepress folder and write such code:
// enhanceApp.js

import { registry } from 'vuepress-theme-vuescroll';

export default ({ Vue, router, store }) => {
  // Your vuescroll options of most outside element.
  let ops = {
    bar: {
      background: '#3eaf7c'
    },
    rail: {
      gutterOfEnds: '60px'
    },
    scrollPanel: {
      scrollingX: false
    }
  };

  registry({ Vue, router, store }, ops);
};
  1. That's all, you can use vuescroll in your own App!

Current Vuepress Version

0.13.1

License

MIT