Set options per call
Closed this issue · 4 comments
pdcmoreira commented
Is there a way to pass custom options on each call?
Something like this.$awn.tip('Hello world!', options)
.
mrbookt commented
It's possible to change global options on the fly for ex.:
this.$awn.options.labels.success = 'new success label';
this.$awn.success('some message');
pdcmoreira commented
Sure, but then I have to do something like...
let oldSuccessLabel = this.$awn.options.labels.success // Save original option
this.$awn.options.labels.success = 'new success label' // Set my specific, one-time option
this.$awn.success('some message')
this.$awn.options.labels.success = oldSuccessLabel // Restore the original option
...for each call!
mrbookt commented
yep, unfortunately this is the only way for now as far as I know. The problem is connected to the awesome notifications library (not the vue implementaion) as it sets options upon initialization:
https://github.com/f3oall/awesome-notifications#customization
pdcmoreira commented
This will be implemented in v3.0.0 of awesome-notifications, which, I guess, will be reflected in this package.