Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept options when registering plugin to override defaults #211

Open
a-kriya opened this issue Apr 12, 2020 · 0 comments
Open

Accept options when registering plugin to override defaults #211

a-kriya opened this issue Apr 12, 2020 · 0 comments

Comments

@a-kriya
Copy link

a-kriya commented Apr 12, 2020

It would reduce duplication and declutter templates if the plugin allowed overriding defaults:

import Vue from 'vue'
import VueObserveVisibility from 'vue-observe-visibility'

Vue.use(VueObserveVisibility, {
  once: true
})

If majority of my use cases require once to be set to true, then I can just do that, and if I need to set it to false occasionally, I can still do:

<div v-observe-visibility="{
  callback: visibilityChanged,
  once: false,
}">

This applies to all options, and so could also resolve #201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant