IbtSnackbar.vue 618 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <md-snackbar md-position="top center" ref="snackbar">
  3. <span>{{ snackbackMessage }}</span>
  4. <md-button @click.native="$refs.snackbar.close()" class="snackbar-close">[x]</md-button>
  5. </md-snackbar>
  6. </template>
  7. <script>
  8. export default {
  9. data: function() {
  10. return {snackbackMessage: 'something happened'};
  11. },
  12. methods: {
  13. show(message) {
  14. this.snackbackMessage = message || snackbackMessage;
  15. this.$refs.snackbar.open();
  16. }
  17. }
  18. }
  19. </script>
  20. <style scoped>
  21. .snackbar-close {
  22. font-weight: bold;
  23. color: #f6f72f;
  24. }
  25. </style>