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.

grid.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. export default function Grid(name) {
  2. /* @vue/component */
  3. return {
  4. name: 'v-' + name,
  5. functional: true,
  6. props: {
  7. id: String,
  8. tag: {
  9. type: String,
  10. default: 'div'
  11. }
  12. },
  13. render: function render(h, _ref) {
  14. var props = _ref.props,
  15. data = _ref.data,
  16. children = _ref.children;
  17. data.staticClass = (name + ' ' + (data.staticClass || '')).trim();
  18. var attrs = data.attrs;
  19. if (attrs) {
  20. // reset attrs to extract utility clases like pa-3
  21. data.attrs = {};
  22. var classes = Object.keys(attrs).filter(function (key) {
  23. // TODO: Remove once resolved
  24. // https://github.com/vuejs/vue/issues/7841
  25. if (key === 'slot') return false;
  26. var value = attrs[key];
  27. // add back data attributes like data-test="foo" but do not
  28. // add them as classes
  29. if (key.startsWith('data-')) {
  30. data.attrs[key] = value;
  31. return false;
  32. }
  33. return value || typeof value === 'string';
  34. });
  35. if (classes.length) data.staticClass += ' ' + classes.join(' ');
  36. }
  37. if (props.id) {
  38. data.domProps = data.domProps || {};
  39. data.domProps.id = props.id;
  40. }
  41. return h(props.tag, data, children);
  42. }
  43. };
  44. }
  45. //# sourceMappingURL=grid.js.map