Fixed #1187 - Constants for Toast severities

pull/1478/head
Tuğçe Küçükoğlu 2021-08-24 10:33:48 +03:00
parent 1ecaba2b87
commit e28ca17eca
3 changed files with 25 additions and 1 deletions

View File

@ -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};

View File

@ -0,0 +1,8 @@
const ToastSeverities = {
INFO: 'info',
WARN: 'warn',
ERROR: 'error',
SUCCESS: 'success'
};
export default ToastSeverities;

View File

@ -219,6 +219,21 @@ this.$toast.add({severity:'success', summary: 'Specific Message', group: 'mykey'
<pre v-code><code> <pre v-code><code>
&lt;Toast :breakpoints="&#123;'920px': &#123;width: '100%', right: '0', left: '0'&#125;&#125;"&gt;&lt;/Toast&gt; &lt;Toast :breakpoints="&#123;'920px': &#123;width: '100%', right: '0', left: '0'&#125;&#125;"&gt;&lt;/Toast&gt;
</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>