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.

VJumbotron.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. require('../../../src/stylus/components/_jumbotrons.styl');
  6. var _colorable = require('../../mixins/colorable');
  7. var _colorable2 = _interopRequireDefault(_colorable);
  8. var _routable = require('../../mixins/routable');
  9. var _routable2 = _interopRequireDefault(_routable);
  10. var _themeable = require('../../mixins/themeable');
  11. var _themeable2 = _interopRequireDefault(_themeable);
  12. var _console = require('../../util/console');
  13. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14. /* @vue/component */
  15. // Mixins
  16. exports.default = {
  17. name: 'v-jumbotron',
  18. mixins: [_colorable2.default, _routable2.default, _themeable2.default],
  19. props: {
  20. gradient: String,
  21. height: {
  22. type: [Number, String],
  23. default: '400px'
  24. },
  25. src: String,
  26. tag: {
  27. type: String,
  28. default: 'div'
  29. }
  30. },
  31. computed: {
  32. backgroundStyles: function backgroundStyles() {
  33. var styles = {};
  34. if (this.gradient) {
  35. styles.background = 'linear-gradient(' + this.gradient + ')';
  36. }
  37. return styles;
  38. },
  39. classes: function classes() {
  40. return this.themeClasses;
  41. },
  42. styles: function styles() {
  43. return {
  44. height: this.height
  45. };
  46. }
  47. },
  48. mounted: function mounted() {
  49. (0, _console.deprecate)('v-jumbotron', this.src ? 'v-img' : 'v-responsive', this);
  50. },
  51. methods: {
  52. genBackground: function genBackground() {
  53. return this.$createElement('div', this.setBackgroundColor(this.color, {
  54. staticClass: 'v-jumbotron__background',
  55. style: this.backgroundStyles
  56. }));
  57. },
  58. genContent: function genContent() {
  59. return this.$createElement('div', {
  60. staticClass: 'v-jumbotron__content'
  61. }, this.$slots.default);
  62. },
  63. genImage: function genImage() {
  64. if (!this.src) return null;
  65. if (this.$slots.img) return this.$slots.img({ src: this.src });
  66. return this.$createElement('img', {
  67. staticClass: 'v-jumbotron__image',
  68. attrs: { src: this.src }
  69. });
  70. },
  71. genWrapper: function genWrapper() {
  72. return this.$createElement('div', {
  73. staticClass: 'v-jumbotron__wrapper'
  74. }, [this.genImage(), this.genBackground(), this.genContent()]);
  75. }
  76. },
  77. render: function render(h) {
  78. var _generateRouteLink = this.generateRouteLink(this.classes),
  79. tag = _generateRouteLink.tag,
  80. data = _generateRouteLink.data;
  81. data.staticClass = 'v-jumbotron';
  82. data.style = this.styles;
  83. return h(tag, data, [this.genWrapper()]);
  84. }
  85. };
  86. // Utils
  87. //# sourceMappingURL=VJumbotron.js.map