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.

measurable.js 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. // Helpers
  2. import { convertToUnit } from '../util/helpers';
  3. // Types
  4. import Vue from 'vue';
  5. export default Vue.extend({
  6. name: 'measurable',
  7. props: {
  8. height: [Number, String],
  9. maxHeight: [Number, String],
  10. maxWidth: [Number, String],
  11. minHeight: [Number, String],
  12. minWidth: [Number, String],
  13. width: [Number, String]
  14. },
  15. computed: {
  16. measurableStyles: function measurableStyles() {
  17. var styles = {};
  18. var height = convertToUnit(this.height);
  19. var minHeight = convertToUnit(this.minHeight);
  20. var minWidth = convertToUnit(this.minWidth);
  21. var maxHeight = convertToUnit(this.maxHeight);
  22. var maxWidth = convertToUnit(this.maxWidth);
  23. var width = convertToUnit(this.width);
  24. if (height) styles.height = height;
  25. if (minHeight) styles.minHeight = minHeight;
  26. if (minWidth) styles.minWidth = minWidth;
  27. if (maxHeight) styles.maxHeight = maxHeight;
  28. if (maxWidth) styles.maxWidth = maxWidth;
  29. if (width) styles.width = width;
  30. return styles;
  31. }
  32. }
  33. });
  34. //# sourceMappingURL=measurable.js.map