Fixed #1187 - Constants for Toast severities
parent
1ecaba2b87
commit
e28ca17eca
|
@ -2,5 +2,6 @@ import FilterMatchMode from './FilterMatchMode';
|
||||||
import FilterOperator from './FilterOperator';
|
import FilterOperator from './FilterOperator';
|
||||||
import FilterService from './FilterService';
|
import FilterService from './FilterService';
|
||||||
import PrimeIcons from './PrimeIcons';
|
import PrimeIcons from './PrimeIcons';
|
||||||
|
import ToastSeverity from './ToastSeverity';
|
||||||
|
|
||||||
export {FilterMatchMode,FilterOperator,FilterService,PrimeIcons};
|
export {FilterMatchMode,FilterOperator,FilterService,PrimeIcons,ToastSeverity};
|
|
@ -0,0 +1,8 @@
|
||||||
|
const ToastSeverities = {
|
||||||
|
INFO: 'info',
|
||||||
|
WARN: 'warn',
|
||||||
|
ERROR: 'error',
|
||||||
|
SUCCESS: 'success'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ToastSeverities;
|
|
@ -219,6 +219,21 @@ this.$toast.add({severity:'success', summary: 'Specific Message', group: 'mykey'
|
||||||
<pre v-code><code>
|
<pre v-code><code>
|
||||||
<Toast :breakpoints="{'920px': {width: '100%', right: '0', left: '0'}}"></Toast>
|
<Toast :breakpoints="{'920px': {width: '100%', right: '0', left: '0'}}"></Toast>
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h5>Constants</h5>
|
||||||
|
<p>ToastSeverity constants API is provided to easily choose a severity of the message with typescript.</p>
|
||||||
|
<pre v-code.script><code>
|
||||||
|
import {ToastSeverity} from 'primevue/api';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
showInfo() {
|
||||||
|
this.$toast.add({severity: ToastSeverity.INFO, summary: 'Info Message', detail:'Message Content', life: 3000});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h5>Properties</h5>
|
<h5>Properties</h5>
|
||||||
|
|
Loading…
Reference in New Issue