Socket
Socket
Sign inDemoInstall

cool-vue-scrollbar

Package Overview
Dependencies
11
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cool-vue-scrollbar

npm install --save cool-vue-scrollbar


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

scroll-bar

自定义PC端滚动条,可以设置滚动条颜色,宽度,边框弧度半径等。

1. 安装 Installation

npm install --save cool-vue-scrollbar

2. 使用 Usage

main.js文件 全局

import coolscrollBar from 'cool-vue-scrollbar'
Vue.use(coolscrollBar)

组件中:

Example

<template>
  <div id="app">
    <scroll-bar class="wrapper" :options="options">
      <div class="inner">
       <div style="height:800px"></div>
      </div>
     </scroll-bar>
  </div>
</template>

<script>

export default {
  name: 'App',
  data(){
    return {
      options: {
        innerStyle:{ // 这里是滑块的样式 
          backgroundColor: 'red',
          borderRadius: '5px',
          width: '5px'
        },
        outStyle: { //包裹滑块的容器样式
        width: '5px',
        borderRadius: '5px',
        backgroundColor: '#fff'
      },
      level :80  //鼠标滚动时滑块移动的级别,默认是20px
      },
      
    }
  },
  methods: {
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.wrapper{
  width:200px;
  height:200px;
  border:1px solid rgb(94, 126, 94);
  margin: 0 auto;
}
.inner{
  background-color: blueviolet;
  width:100px;
  border: 3px solid pink;
}
</style>

Keywords

FAQs

Last updated on 14 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc