Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Commit

Permalink
Allow overriding of directive name
Browse files Browse the repository at this point in the history
Allows overriding the directive name, defaulting to `bar`. E.g.

```js
import Vuebar from 'vuebar';

Vue.use(Vuebar, {
    directive:'custom-scroll'
});
```

```html
<div v-custom-scroll></div>`
```
  • Loading branch information
hailwood authored and DominikSerafin committed Sep 11, 2018
1 parent 2cb8d6f commit 07f9146
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vuebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
\*------------------------------------*/
var Vuebar = {};
Vuebar.install = function(Vue, options){

options = options || {};
options.directive = options.directive || 'bar';


/*------------------------------------*\
Expand Down Expand Up @@ -662,7 +663,7 @@
/*------------------------------------*\
Directive Install
\*------------------------------------*/
Vue.directive('bar', {
Vue.directive(options.directive, {

inserted: function(el, binding, vnode){
initScrollbar.call(this, el, binding);
Expand Down

0 comments on commit 07f9146

Please sign in to comment.