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

[ Help ] Pass a Parameter when a Method is called #13

Open
JojoMig opened this issue Jan 12, 2019 · 1 comment
Open

[ Help ] Pass a Parameter when a Method is called #13

JojoMig opened this issue Jan 12, 2019 · 1 comment
Labels
Projects

Comments

@JojoMig
Copy link

JojoMig commented Jan 12, 2019

Hi, is there a way to pass a parameter (object or not) when a method is called, so any Button Actions can have this parameter to process? Like:
this.$toast.show('Welcome!', 'Hey', {parameters}, notificationSystem.options.show);
any help is appreciated thanks in advance

@arthurvasconcelos
Copy link
Owner

Hi, @JojoMig when you are using Button Actions you already define the parameters that it uses in the parameter object that you pass to show method.

buttons: [
        ['<button>Ok</button>', function (instance, toast) {
            alert("Hello world!");
        }, true], // true to focus
        ['<button>Close</button>', function (instance, toast) {
            Vue.toast.hide(toast, {
                transitionOut: 'fadeOutUp',
                onClosing: function(instance, toast, closedBy){
                    console.info('closedBy: ' + closedBy); // The return will be: 'closedBy: buttonName'
                }
            });
        }]
    ]

This solves your problem or are you trying to do something else? If so, please can you provide an example?

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

No branches or pull requests

2 participants