css改变滚动条样式兼容火狐_3个超赞的 vue.js 自定义滚动条组件VueScrollbar

本文介绍了三款优秀的Vue.js自定义滚动条组件:OverlayScrollbars(跨框架,兼容IE8+),Vuebar(丰富的配置和自定义样式)和Vue-Custom-ScrollBar(易于使用,滚动条样式可完全自定义)。这些组件能提升用户体验,且易于集成到项目中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天给小伙伴们推荐3款超美观高效的Vue自定义滚动条组件Vue-Scrollbar。

bdb3e7c65a7684c9c195e21a6dae5e1f.png

1、OverlayScrollbars

overlayscrollbars 一款优秀高质量的自定义滚动条插件,star高达1.4K+。支持跨框架使用 (js vue react angular),兼容IE8+及主流浏览器

b295f6541782fc59e260c5f7406e4ce3.png
8e61ae496a897cf2726c10fad9a0fc64.png

浏览器支持度

b35de76eaac1f654ae40a2f70870c642.png

跨框架使用

在jQuery中使用

$(function() {  $('body').overlayScrollbars({ });});

在Vue页面中使用

f2d70c5c14a901aedca93e32ca9069f2.png
// 安装依赖$ npm i overlayscrollbars-vue -S
// 在main.js中全局引入import Vue from 'vue';import { OverlayScrollbarsComponent } from 'overlayscrollbars-vue';Vue.component('overlay-scrollbars', OverlayScrollbarsComponent);// 页面局部引入
// 在页面模板中使用  example content  
4557593eaef3796944f3122adc533736.png
667d8bc2d5ae763f1791e68e17aec689.png
c08d7218211bccff201d9d6bccb1b30c.png
1bacd528deb49595f8cd7afdfa9021ad.png
# 官网地址https://kingsora.github.io/OverlayScrollbars/# vue页面示例地址https://kingsora.github.io/OverlayScrollbars/frameworks/vue/# 仓库地址https://github.com/KingSora/OverlayScrollbars

2、Vuebar

vuebar 基于 vue.js 构建的自定义滚动条组件。丰富的参数配置及支持自定义样式。

27b8e3d5786e565ca801dccf4c431b74.png

安装

$ npm i vuebar -S

使用插件

// 全局引入import Vue from 'vue';import Vuebar from 'vuebar';Vue.use(Vuebar);// 基本使用
your scrollable content
// 配置参数
your scrollable content
e1544bca3ad7fbc3231f051b6ffbe297.png
# 文档地址https://github.serafin.io/vuebar/# 仓库地址https://github.com/DominikSerafin/vuebar
30c9fa15f66ab20ea2903d8d59867406.png

3、Vue-Custom-ScrollBar

vue-custom-scrollbar 一款基于 Vue.js 简约完美的自定义滚动条组件。易于使用,支持自定义滚动条样式。

60df526401c5fd63296a29fc59fa32b1.png
4bdd8ebb0aa92cf83f9ca34057ab944a.png

特点

  • 不改变设计布局
  • 不需要手动操作 DOM
  • 使用普通的 scrollTop and scrollLeft
  • 滚动条样式可完全自定义
  • 布局更改后更新

安装

$ npm i vue-custom-scrollbar -S

使用插件

azusa.jpg
e27b89e894530272db5927ec8f494675.png
# 文档地址https://binaryify.github.io/vue-custom-scrollbar/# 仓库地址https://github.com/Binaryify/vue-custom-scrollbar

ok,就分享到这里。如果大家有其它好的Vue滚动条组件,欢迎一起分享交流哈!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值