Vue.js minimalistic but powerful wrapper for perfect scrollbar Why I Created it ? Because I ️to useperfect-scrollbarin my projects (🙌utatti). But also because the current solutions on github are outdated or overcomplicated. Why would you use it ?
一、安装npm install vue-perfect-scrollbar cmd进入项目根目录,执行如下命令: cnpm install vue-perfect-scrollbar 二、新建scrollbar.vue文件 1、引入 import VuePerfectScrollbarfrom'vue-perfect-scrollbar/index.vue' 2、注册 components: { VuePerfectScrollbar }, 3、使用 <VuePerfectScrollbarclass="scroll">...
componentUpdated(el, binding, vnode, oldVnode) { //vnode.context其实就是vue实例,这里其实无需实例也直接用Vue的静态方法 //故而也可以写成Vue.nextTick vnode.context.$nextTick( () => { el_scrollBar(el); } ) } }) 至此,我们完成了PerfectScrollbar在vue的准备工作 接下来我们试试如何调用。 用法...
1.install 1 npm install vue-perfect-scrollbar 2、 <template> <VuePerfectScrollbar class="scroll"> 323232232 323232232 323232232 323232232 323232232 323232232 </VuePerfectScrollbar> </template> import VuePerfectScrollbar from'vue-perfect-scrollbar'exportdefault{ name:'scrollBar', data () {re...
简介:Vue.js - Vue下使用perfect-scrollbar(在特定框架里使用一款并非为该框架定制的库/插件) 其实,如何在特定框架里使用一款并非为该框架定制的库/插件,只有两点: 1. 熟悉这个框架 2. 熟悉这个库/插件的工作原理 说完废话,进入正题。 perfect-scrollbar是一款轻量级的滚动插件,具体介绍详见其官网 ...
在Vue 3的setup语法糖中,你可以使用perfect-scrollbar库来创建自定义滚动条,并为它添加滚动事件监听器。以下是详细步骤: 安装并引入perfect-scrollbar库: 首先,你需要安装perfect-scrollbar库。你可以通过npm或yarn来安装它: bash npm install perfect-scrollbar 或者 bash yarn add perfect-scrollbar 然后,在你...
Vue.js minimalistic but powerful wrapper for perfect scrollbar Why I Created it ? Because I ️ to useperfect-scrollbarin my projects (🙌utatti). But also because the current solutions on github are outdated or overcomplicated.
This project (vue2-perfect-scrollbar) is no longer actively developed or maintained. If you are seeking a version compatible with Vue 3, you can find it here:https://github.com/mercs600/vue3-perfect-scrollbar. For any issues or bugs related to the core functionality of the Perfect Scroll...
Integrate vue3-perfect-scrollbar globally in your main application file: import{createApp}from'vue';import{PerfectScrollbarPlugin}from'vue3-perfect-scrollbar';import'vue3-perfect-scrollbar/style.css';importAppfrom'./App.vue';createApp(App).use(PerfectScrollbarPlugin).mount('#app'); ...
perfect-scrollbarvue version 1.install npm install vue-perfect-scrollbar 2. example 2.1 base example <template><VuePerfectScrollbarclass="scroll-area"v-once:settings="settings"@ps-scroll-y="scrollHandle"></VuePerfectScrollbar></template>importVuePerfectScrollbarfrom'vue-perfect-scrollbar'exportdefa...