Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VMessages.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Styles
  2. import '../../../src/stylus/components/_messages.styl';
  3. // Mixins
  4. import Colorable from '../../mixins/colorable';
  5. import Themeable from '../../mixins/themeable';
  6. import mixins from '../../util/mixins';
  7. /* @vue/component */
  8. export default mixins(Colorable, Themeable).extend({
  9. name: 'v-messages',
  10. props: {
  11. value: {
  12. type: Array,
  13. default: function _default() {
  14. return [];
  15. }
  16. }
  17. },
  18. methods: {
  19. genChildren: function genChildren() {
  20. return this.$createElement('transition-group', {
  21. staticClass: 'v-messages__wrapper',
  22. attrs: {
  23. name: 'message-transition',
  24. tag: 'div'
  25. }
  26. }, this.value.map(this.genMessage));
  27. },
  28. genMessage: function genMessage(message, key) {
  29. return this.$createElement('div', {
  30. staticClass: 'v-messages__message',
  31. key: key,
  32. domProps: {
  33. innerHTML: message
  34. }
  35. });
  36. }
  37. },
  38. render: function render(h) {
  39. return h('div', this.setTextColor(this.color, {
  40. staticClass: 'v-messages',
  41. class: this.themeClasses
  42. }), [this.genChildren()]);
  43. }
  44. });
  45. //# sourceMappingURL=VMessages.js.map