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.

VBadge.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Styles
  2. import '../../../src/stylus/components/_badges.styl';
  3. // Mixins
  4. import Colorable from '../../mixins/colorable';
  5. import Toggleable from '../../mixins/toggleable';
  6. import { factory as PositionableFactory } from '../../mixins/positionable';
  7. import Transitionable from '../../mixins/transitionable';
  8. import mixins from '../../util/mixins';
  9. export default mixins(Colorable, Toggleable, PositionableFactory(['left', 'bottom']), Transitionable
  10. /* @vue/component */
  11. ).extend({
  12. name: 'v-badge',
  13. props: {
  14. color: {
  15. type: String,
  16. default: 'primary'
  17. },
  18. overlap: Boolean,
  19. transition: {
  20. type: String,
  21. default: 'fab-transition'
  22. },
  23. value: {
  24. default: true
  25. }
  26. },
  27. computed: {
  28. classes: function classes() {
  29. return {
  30. 'v-badge--bottom': this.bottom,
  31. 'v-badge--left': this.left,
  32. 'v-badge--overlap': this.overlap
  33. };
  34. }
  35. },
  36. render: function render(h) {
  37. var badge = this.$slots.badge && [h('span', this.setBackgroundColor(this.color, {
  38. staticClass: 'v-badge__badge',
  39. attrs: this.$attrs,
  40. directives: [{
  41. name: 'show',
  42. value: this.isActive
  43. }]
  44. }), this.$slots.badge)];
  45. return h('span', {
  46. staticClass: 'v-badge',
  47. 'class': this.classes
  48. }, [this.$slots.default, h('transition', {
  49. props: {
  50. name: this.transition,
  51. origin: this.origin,
  52. mode: this.mode
  53. }
  54. }, badge)]);
  55. }
  56. });
  57. //# sourceMappingURL=VBadge.js.map