Item.js 500 B

12345678910111213141516171819202122
  1. import { cloneVNode } from 'vue';
  2. import { flattenChildren } from '../_util/props-util';
  3. const Item = (_ref, _ref2) => {
  4. let {
  5. setRef
  6. } = _ref;
  7. let {
  8. slots
  9. } = _ref2;
  10. var _a;
  11. const children = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
  12. return children && children.length ? cloneVNode(children[0], {
  13. ref: setRef
  14. }) : children;
  15. };
  16. Item.props = {
  17. setRef: {
  18. type: Function,
  19. default: () => {}
  20. }
  21. };
  22. export default Item;