zent
Version:
一套前端设计语言和基于React的实现
12 lines (11 loc) • 634 B
JavaScript
import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import Select from '../../select';
import { FormField } from '../Field';
function renderSelect(childProps, props) {
return _jsx(Select, __assign({}, props.props, childProps), void 0);
}
export function FormSelectField(props) {
var _a, _b;
return (_jsx(FormField, __assign({}, props, { defaultValue: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : (((_b = props.props) === null || _b === void 0 ? void 0 : _b.multiple) ? [] : null) }, { children: function (childProps) { return renderSelect(childProps, props); } }), void 0));
}