Files
PartsInquiry/admin/node_modules/element-plus/es/components/select-v2/src/useProps.mjs
2025-09-24 20:35:15 +08:00

27 lines
731 B
JavaScript

import { computed } from 'vue';
import { get } from 'lodash-unified';
const defaultProps = {
label: "label",
value: "value",
disabled: "disabled",
options: "options"
};
function useProps(props) {
const aliasProps = computed(() => ({ ...defaultProps, ...props.props }));
const getLabel = (option) => get(option, aliasProps.value.label);
const getValue = (option) => get(option, aliasProps.value.value);
const getDisabled = (option) => get(option, aliasProps.value.disabled);
const getOptions = (option) => get(option, aliasProps.value.options);
return {
aliasProps,
getLabel,
getValue,
getDisabled,
getOptions
};
}
export { defaultProps, useProps };
//# sourceMappingURL=useProps.mjs.map