Fixed animations of Toast and Messages
parent
c182f92c96
commit
d855b68897
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="containerClass">
|
<div :class="containerClass">
|
||||||
<ToastMessage v-for="msg of messages" :key="msg.id" :message="msg" @close="remove($event)"/>
|
<transition-group name="p-toast-message" tag="div">
|
||||||
|
<ToastMessage v-for="msg of messages" :key="msg.id" :message="msg" @close="remove($event)"/>
|
||||||
|
</transition-group>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="p-toast-message">
|
<div :class="containerClass">
|
||||||
<div :class="containerClass">
|
<div class="p-toast-item">
|
||||||
<div class="p-toast-item">
|
<button class="p-toast-icon-close p-link" @click="close">
|
||||||
<button class="p-toast-icon-close p-link" @click="close">
|
<span class="p-toast-icon-close-icon pi pi-times"></span>
|
||||||
<span class="p-toast-icon-close-icon pi pi-times"></span>
|
</button>
|
||||||
</button>
|
<span :class="iconClass"></span>
|
||||||
<span :class="iconClass"></span>
|
<div class="p-toast-message">
|
||||||
<div class="p-toast-message">
|
<span class="p-toast-title">{{message.summary}}</span>
|
||||||
<span class="p-toast-title">{{message.summary}}</span>
|
<div class="p-toast-detail">{{message.detail}}</div>
|
||||||
<div class="p-toast-detail">{{message.detail}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
<h3>Dynamic</h3>
|
<h3>Dynamic</h3>
|
||||||
<Button label="Show" @click="addMessages()" />
|
<Button label="Show" @click="addMessages()" />
|
||||||
<Button label="Clear" @click="removeMessages()" class="p-button-secondary"/>
|
<Button label="Clear" @click="removeMessages()" class="p-button-secondary"/>
|
||||||
<Message v-for="msg of messages" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
<transition-group name="p-messages" tag="div">
|
||||||
|
<Message v-for="msg of messages" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
||||||
|
</transition-group>
|
||||||
|
|
||||||
<h3>Auto Dismiss</h3>
|
<h3>Auto Dismiss</h3>
|
||||||
<Message severity="warn" :life="10000" :sticky="false">This message will hide in 10 seconds.</Message>
|
<Message severity="warn" :life="10000" :sticky="false">This message will hide in 10 seconds.</Message>
|
||||||
|
|
|
@ -250,7 +250,10 @@ import Message from 'primevue/message';
|
||||||
<h3>Dynamic</h3>
|
<h3>Dynamic</h3>
|
||||||
<Button label="Show" @click="addMessages()" />
|
<Button label="Show" @click="addMessages()" />
|
||||||
<Button label="Clear" @click="removeMessages()" class="p-button-secondary"/>
|
<Button label="Clear" @click="removeMessages()" class="p-button-secondary"/>
|
||||||
<Message v-for="msg of messages" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
|
||||||
|
<transition-group name="p-messages" tag="div">
|
||||||
|
<Message v-for="msg of messages" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
|
||||||
|
</transition-group>
|
||||||
|
|
||||||
<h3>Auto Dismiss</h3>
|
<h3>Auto Dismiss</h3>
|
||||||
<Message severity="warn" :life="10000" :sticky="false">This message will hide in 10 seconds.</Message>
|
<Message severity="warn" :life="10000" :sticky="false">This message will hide in 10 seconds.</Message>
|
||||||
|
|
Loading…
Reference in New Issue