1
This commit is contained in:
26
admin/node_modules/element-plus/es/components/select-v2/src/useProps.mjs
generated
vendored
Normal file
26
admin/node_modules/element-plus/es/components/select-v2/src/useProps.mjs
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user