Vue Flash Message
  • Getting Started
  • Configuration Object
  • Basic Usage
  • Public Methods
  • Data Object
  • Callbacks Object
  • Raw HTML
  • Custom Component
Powered by GitBook
On this page

Was this helpful?

Public Methods

You can manipulate flash message with several methods

PreviousBasic UsageNextData Object

Last updated 5 years ago

Was this helpful?

Display Methods

Every display message method will return the id of the message instance. You can pass the to configure a message instance as first argument and as second argument.

// Basic usage
this.flashMessage.show({
    status: 'error',
    title: 'Error Message Title',
    message: 'Oh, you broke my heart! Shame on you!'
});

You also can use shorthands without status property

this.flashMessage.error({
	title: 'Error Message Title',
	message: 'Oh, you broke my heart! Shame on you!'
});
this.flashMessage.warning({
	title: 'Warning Message Title',
	message: "Don't stop me nooooow....!"
});
this.flashMessage.info({
	title: 'Info Message Title',
	message: 'Just want you to know, that Vue is so cool'
});
this.flashMessage.success({
	title: 'Success Message Title',
	message: 'Hoorah, it is my fist npm package and it works!'
});

Delete Method

You can delete message programmatically using deleteMessage method

let id = this.flashMessage.info({
	title: 'Hey, man. Time for beer!',
	message: 'It is Friday. Time to have a little party.'
});
this.flashMessage.deleteMessage(id);

Switch strategy method

You can update default strategy using setStrategy method.

/* Will return {Boolean} as result */
this.flashMessage.setStrategy('multiple'); // strategy changed to multiple
data object
callbacks object