chore: Snackbar duplicate key warnings (#2121)
* fix the duplicate key warning in woot snackbar * review fixes * remove console.log Co-authored-by: Nithin David <webofnithin@gmail.com>
This commit is contained in:
parent
654893b6d7
commit
773557e49b
1 changed files with 3 additions and 4 deletions
|
@ -2,14 +2,13 @@
|
|||
<transition-group name="toast-fade" tag="div" class="ui-snackbar-container">
|
||||
<woot-snackbar
|
||||
v-for="snackMessage in snackMessages"
|
||||
:key="snackMessage"
|
||||
:message="snackMessage"
|
||||
:key="snackMessage.key"
|
||||
:message="snackMessage.message"
|
||||
/>
|
||||
</transition-group>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* global bus */
|
||||
import WootSnackbar from './Snackbar';
|
||||
|
||||
export default {
|
||||
|
@ -31,7 +30,7 @@ export default {
|
|||
|
||||
mounted() {
|
||||
bus.$on('newToastMessage', message => {
|
||||
this.snackMessages.push(message);
|
||||
this.snackMessages.push({ key: new Date().getTime(), message });
|
||||
window.setTimeout(() => {
|
||||
this.snackMessages.splice(0, 1);
|
||||
}, this.duration);
|
||||
|
|
Loading…
Reference in a new issue