nathanbuchar / electron-settings

📝 A simple persistent user settings framework for Electron.
https://electron-settings.js.org
MIT License
817 stars 60 forks source link

Can I use it globally? #82

Closed mmikhan closed 7 years ago

mmikhan commented 7 years ago

Instead of importing the electron-settings from all the components, can I import it directly from the main.js file like the following?

import Settings from 'electron-settings'

Vue.use(Settings)

If so, how would you call it from the single components?

mmikhan commented 7 years ago

Were able to achieve this like the following:

import Settings from 'electron-settings'

Vue.settings = Vue.prototype.$settings = Settings

We can then call the electron-settings like the following directly from the single components:

this.$settings.set('user.name', 'John Doe')