Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Using toastr in Vue Component


Hi all,

I'm playing around with the Metronic demo 1 (Vue Version).

How can I trigger a Toastr when the component is mounted? I have no idea. I can't find anything in the docs for the Vue version of the template.

Regards


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


A quick update. I had to do
import { ElNotification } from "element-plus";
in my view and to trigger a notification.

To trigger the notification simply:

methods: {
triggerNotification() {
ElNotification({
title: "Success",
message: "This is a success message",
type: "success",
});
},
},


Thanks for your help.



Hi,

Glad to hear it worked for you!

Please let us know if you have any additional questions on this topic or anything else.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi Lauris,

thanks for your reply. Is there also a demo of the usage of Element Plus Notification in demo 1? I can't find this component.

Regards
Andrew



Hi,

Thank you for reaching out to us.

By default, in our Vue theme, you can use the Element Plus Notification component

Also, as an alternative you can install and use vue-toast-notification, this component is not included in Metronic default package but we have plans on using it in the future releases.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(