slots.js 546 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.SlotsMixin = void 0;
  4. /**
  5. * Use scopedSlots in Vue 2.6+
  6. * downgrade to slots in lower version
  7. */
  8. var SlotsMixin = {
  9. methods: {
  10. slots: function slots(name, props) {
  11. if (name === void 0) {
  12. name = 'default';
  13. }
  14. var $slots = this.$slots,
  15. $scopedSlots = this.$scopedSlots;
  16. var scopedSlot = $scopedSlots[name];
  17. if (scopedSlot) {
  18. return scopedSlot(props);
  19. }
  20. return $slots[name];
  21. }
  22. }
  23. };
  24. exports.SlotsMixin = SlotsMixin;