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.

positionable.js 934B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import Vue from 'vue';
  2. import { filterObjectOnKeys } from '../util/helpers';
  3. var availableProps = {
  4. absolute: Boolean,
  5. bottom: Boolean,
  6. fixed: Boolean,
  7. left: Boolean,
  8. right: Boolean,
  9. top: Boolean
  10. };
  11. export function factory() {
  12. var selected = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13. return Vue.extend({
  14. name: 'positionable',
  15. props: selected.length ? filterObjectOnKeys(availableProps, selected) : availableProps
  16. });
  17. }
  18. export default factory();
  19. // Add a `*` before the second `/`
  20. /* Tests /
  21. let single = factory(['top']).extend({
  22. created () {
  23. this.top
  24. this.bottom
  25. this.absolute
  26. }
  27. })
  28. let some = factory(['top', 'bottom']).extend({
  29. created () {
  30. this.top
  31. this.bottom
  32. this.absolute
  33. }
  34. })
  35. let all = factory().extend({
  36. created () {
  37. this.top
  38. this.bottom
  39. this.absolute
  40. this.foobar
  41. }
  42. })
  43. /**/
  44. //# sourceMappingURL=positionable.js.map