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.

VTabsItems.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _VWindow = require('../VWindow/VWindow');
  6. var _VWindow2 = _interopRequireDefault(_VWindow);
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. /* @vue/component */
  9. exports.default = _VWindow2.default.extend({
  10. name: 'v-tabs-items',
  11. inject: {
  12. registerItems: {
  13. default: null
  14. },
  15. tabProxy: {
  16. default: null
  17. },
  18. unregisterItems: {
  19. default: null
  20. }
  21. },
  22. props: {
  23. cycle: Boolean
  24. },
  25. watch: {
  26. internalValue: function internalValue(val) {
  27. /* istanbul ignore else */
  28. if (this.tabProxy) this.tabProxy(val);
  29. }
  30. },
  31. created: function created() {
  32. this.registerItems && this.registerItems(this.changeModel);
  33. },
  34. beforeDestroy: function beforeDestroy() {
  35. this.unregisterItems && this.unregisterItems();
  36. },
  37. methods: {
  38. changeModel: function changeModel(val) {
  39. this.internalValue = val;
  40. },
  41. // For backwards compatability with v1.2
  42. getValue: function getValue(item, i) {
  43. /* istanbul ignore if */
  44. if (item.id) return item.id;
  45. return _VWindow2.default.options.methods.getValue.call(this, item, i);
  46. },
  47. next: function next() {
  48. if (!this.cycle && this.internalIndex === this.items.length - 1) {
  49. return;
  50. }
  51. _VWindow2.default.options.methods.next.call(this);
  52. },
  53. prev: function prev() {
  54. if (!this.cycle && this.internalIndex === 0) {
  55. return;
  56. }
  57. _VWindow2.default.options.methods.prev.call(this);
  58. }
  59. }
  60. }); // Extensions
  61. //# sourceMappingURL=VTabsItems.js.map