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

Add example where icon can be added by function #215

Open
IlyaBerzhanin opened this issue Jan 10, 2022 · 1 comment
Open

Add example where icon can be added by function #215

IlyaBerzhanin opened this issue Jan 10, 2022 · 1 comment

Comments

@IlyaBerzhanin
Copy link

Hi, I had a task to add custom icon to the toast, so tried to find the example in docs, but didn't succeed.
Here is the example from docs:
Screenshot 2022-01-10 at 16 13 20

But if after setting "iconPack: 'callback'; " we can use prop "icon" as function which returns us HTMLelement:
Screenshot 2022-01-10 at 16 16 45

So it is not an issue, maybe some kind of recommendation to add such an example to docs as it was not obvious for me and I suppose some people can also get stuck for a while.

Thanks a lot!

@malayhm
Copy link

malayhm commented Nov 18, 2022

@IlyaBerzhanin Could you please share the code snippet with plugin initialization and usage?

The following seems to work for me:
Initialization:

Vue.use(Toasted, { iconPack: 'custom-class' });

Usage:

this.$toasted.info('This is a info alert—check it out!', {
      duration: 0,
      icon: 'my-info-icon',
});

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

2 participants