b668592d4ac7ac298c466b876e73702b1165c17c199ca5ea8328db57e9a7070a274571ba7855a1efe1fb94d9ef96664f1e598fdb74fe9ddfcb733a62444594 731 B

1234567891011121314151617181920212223242526
  1. import { computed } from 'vue';
  2. import { get } from 'lodash-unified';
  3. const defaultProps = {
  4. label: "label",
  5. value: "value",
  6. disabled: "disabled",
  7. options: "options"
  8. };
  9. function useProps(props) {
  10. const aliasProps = computed(() => ({ ...defaultProps, ...props.props }));
  11. const getLabel = (option) => get(option, aliasProps.value.label);
  12. const getValue = (option) => get(option, aliasProps.value.value);
  13. const getDisabled = (option) => get(option, aliasProps.value.disabled);
  14. const getOptions = (option) => get(option, aliasProps.value.options);
  15. return {
  16. aliasProps,
  17. getLabel,
  18. getValue,
  19. getDisabled,
  20. getOptions
  21. };
  22. }
  23. export { defaultProps, useProps };
  24. //# sourceMappingURL=useProps.mjs.map