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.

VAvatar.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536
  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. import '../../../src/stylus/components/_avatars.styl';
  3. // Mixins
  4. import Colorable from '../../mixins/colorable';
  5. import { convertToUnit } from '../../util/helpers';
  6. import mixins from '../../util/mixins';
  7. /* @vue/component */
  8. export default mixins(Colorable).extend({
  9. name: 'v-avatar',
  10. functional: true,
  11. props: {
  12. // TODO: inherit these
  13. color: String,
  14. size: {
  15. type: [Number, String],
  16. default: 48
  17. },
  18. tile: Boolean
  19. },
  20. render: function render(h, _ref) {
  21. var data = _ref.data,
  22. props = _ref.props,
  23. children = _ref.children;
  24. data.staticClass = ('v-avatar ' + (data.staticClass || '')).trim();
  25. if (props.tile) data.staticClass += ' v-avatar--tile';
  26. var size = convertToUnit(props.size);
  27. data.style = _extends({
  28. height: size,
  29. width: size
  30. }, data.style);
  31. return h('div', Colorable.options.methods.setBackgroundColor(props.color, data), children);
  32. }
  33. });
  34. //# sourceMappingURL=VAvatar.js.map