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.

VCounter.js 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2. // Styles
  3. import '../../../src/stylus/components/_counters.styl';
  4. // Mixins
  5. import Themeable, { functionalThemeClasses } from '../../mixins/themeable';
  6. import mixins from '../../util/mixins';
  7. /* @vue/component */
  8. export default mixins(Themeable).extend({
  9. name: 'v-counter',
  10. functional: true,
  11. props: {
  12. value: {
  13. type: [Number, String],
  14. default: ''
  15. },
  16. max: [Number, String]
  17. },
  18. render: function render(h, ctx) {
  19. var props = ctx.props;
  20. var max = parseInt(props.max, 10);
  21. var value = parseInt(props.value, 10);
  22. var content = max ? value + ' / ' + max : String(props.value);
  23. var isGreater = max && value > max;
  24. return h('div', {
  25. staticClass: 'v-counter',
  26. class: _extends({
  27. 'error--text': isGreater
  28. }, functionalThemeClasses(ctx))
  29. }, content);
  30. }
  31. });
  32. //# sourceMappingURL=VCounter.js.map