VItem.mjs 819 B

123456789101112131415161718192021222324252627282930313233
  1. // Composables
  2. import { VItemGroupSymbol } from "./VItemGroup.mjs";
  3. import { makeGroupItemProps, useGroupItem } from "../../composables/group.mjs"; // Utilities
  4. import { genericComponent } from "../../util/index.mjs";
  5. export const VItem = genericComponent()({
  6. name: 'VItem',
  7. props: makeGroupItemProps(),
  8. emits: {
  9. 'group:selected': val => true
  10. },
  11. setup(props, _ref) {
  12. let {
  13. slots
  14. } = _ref;
  15. const {
  16. isSelected,
  17. select,
  18. toggle,
  19. selectedClass,
  20. value,
  21. disabled
  22. } = useGroupItem(props, VItemGroupSymbol);
  23. return () => slots.default?.({
  24. isSelected: isSelected.value,
  25. selectedClass: selectedClass.value,
  26. select,
  27. toggle,
  28. value: value.value,
  29. disabled: disabled.value
  30. });
  31. }
  32. });
  33. //# sourceMappingURL=VItem.mjs.map