vue-perfect-scrollbar is a Vue.js 2 wrapper component for the Perfect Scrollbar library, designed to provide custom, cross-browser scrollbars that mimic native scrolling behavior but offer enhanced styling capabilities. The current version, 0.2.1, was last published 7 years ago, indicating that this specific package is abandoned and no longer actively maintained. While it aimed to simplify the integration of perfect-scrollbar into Vue 2 applications, users looking for modern Vue compatibility (Vue 3) or ongoing maintenance should seek alternative, actively developed wrappers like `vue3-perfect-scrollbar`. This package does not have a regular release cadence due to its abandoned status.
npm install vue-perfect-scrollbarVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `vue-perfect-scrollbar` into a Vue 2 application, showing component registration, prop binding for settings, event handling, and essential CSS for correct rendering. It includes a scrollable content area to visualize the custom scrollbar.
For Vue 3 projects, consider using actively maintained alternatives like `vue3-perfect-scrollbar`. For Vue 2, proceed with caution, acknowledging the lack of updates.
Ensure you `npm install perfect-scrollbar` and `import 'perfect-scrollbar/css/perfect-scrollbar.css'` in your main application file or component styles.
Add `position: relative;` to the CSS class of the element wrapping `vue-perfect-scrollbar`, as shown in the quickstart example (e.g., `.scroll-area { position: relative; }`).Always use version 0.0.14 or newer. Review any manual calls to `init()` or `uninit()` methods if upgrading from very old versions.
Ensure `import VuePerfectScrollbar from 'vue-perfect-scrollbar'` is present in your script, and the component is registered in `components: { VuePerfectScrollbar }` within your Vue component definition.1. Add `import 'perfect-scrollbar/css/perfect-scrollbar.css'` to your project. 2. Ensure the CSS for the scrollable area includes `position: relative;`.
After content changes that affect scrollable size, you may need to manually trigger an update on the Perfect Scrollbar instance. This typically involves accessing the underlying Perfect Scrollbar instance via a Vue ref and calling its `update()` method, though the exact access path can vary (e.g., `this.$refs.myScrollbar.$children[0].update()`).