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.6KB

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